diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-13 19:03:22 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-13 19:03:22 -0700 |
commit | 0941d6054524bc91f45bf3cbb1c641712b0e0e6d (patch) | |
tree | c2ff08811332fe9247ca57f124863d8289ba7844 /revision.c | |
parent | dd57c76e84372bf16c6bdba9a1bd49da3e617339 (diff) | |
parent | 86a0a408b900eecc9d0d4a1eb8ae223181e96679 (diff) | |
download | git-0941d6054524bc91f45bf3cbb1c641712b0e0e6d.tar.gz |
Merge branch 'rs/pending'
* rs/pending:
commit: factor out clear_commit_marks_for_object_array
checkout: use leak_pending flag
bundle: use leak_pending flag
bisect: use leak_pending flag
revision: add leak_pending flag
checkout: use add_pending_{object,sha1} in orphan check
revision: factor out add_pending_sha1
checkout: check for "Previous HEAD" notice in t2020
Conflicts:
builtin/checkout.c
revision.c
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/revision.c b/revision.c index 66a882029f..8764dde381 100644 --- a/revision.c +++ b/revision.c @@ -226,6 +226,13 @@ static struct object *get_reference(struct rev_info *revs, const char *name, con return object; } +void add_pending_sha1(struct rev_info *revs, const char *name, + const unsigned char *sha1, unsigned int flags) +{ + struct object *object = get_reference(revs, name, sha1, flags); + add_pending_object(revs, object, name); +} + static struct commit *handle_commit(struct rev_info *revs, struct object *object, const char *name) { unsigned long flags = object->flags; @@ -897,7 +904,7 @@ static int handle_one_ref(const char *path, const unsigned char *sha1, int flag, struct object *object = get_reference(cb->all_revs, path, sha1, cb->all_flags); add_rev_cmdline(cb->all_revs, object, path, REV_CMD_REF, cb->all_flags); - add_pending_object(cb->all_revs, object, path); + add_pending_sha1(cb->all_revs, path, sha1, cb->all_flags); return 0; } @@ -2050,7 +2057,8 @@ int prepare_revision_walk(struct rev_info *revs) } e++; } - free(list); + if (!revs->leak_pending) + free(list); if (revs->no_walk) return 0; |