builtin-branch: remove duplicated code
The previous optimization to --[no-]merged ended up with some duplicated code which this patch removes. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Hjemli committed
Jul 26, 2008 at 12:27 UTC
346d437aab2496872f477bb759db10a43b5dfb5e
1 file changed
+2
-7
builtin-branch.c
+2
-7
@@ -214,7 +214,6 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
214
struct commit *commit;
215
int kind;
216
int len;
217
- static struct commit_list branch;
217
218
/* Detect kind */
219
if (!prefixcmp(refname, "refs/heads/")) {
@@ -238,13 +237,9 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
237
if ((kind & ref_list->kinds) == 0)
238
return 0;
239
241
- if (merge_filter != NO_FILTER) {
242
- branch.item = lookup_commit_reference_gently(sha1, 1);
243
- if (!branch.item)
244
- die("Unable to lookup tip of branch %s", refname);
240
+ if (merge_filter != NO_FILTER)
241
add_pending_object(&ref_list->revs,
246
- (struct object *)branch.item, refname);
247
- }
242
+ (struct object *)commit, refname);
243
244
/* Resize buffer */
245
if (ref_list->index >= ref_list->alloc) {