@matheusbsbs / matheus-bagliano / commits / 0f31d68030
Fork 0

builtin-branch.c: remove unused code in append_ref() callback function

We let for_each_ref() to feed all refs to append_ref() but we are only ever interested in local or remote tracking branches. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jul 23, 2008 at 14:52 UTC 0f31d68030752b0c1e02a1a092c18094a98202f0
1 file changed +3 -7
builtin-branch.c
+3 -7
@@ -22,10 +22,8 @@ static const char * const builtin_branch_usage[] = {
22 NULL
23 };
24
25 -#define REF_UNKNOWN_TYPE 0x00
25 #define REF_LOCAL_BRANCH 0x01
26 #define REF_REMOTE_BRANCH 0x02
28 -#define REF_TAG 0x04
27
28 static const char *head;
29 static unsigned char head_sha1[20];
@@ -215,7 +213,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
213 {
214 struct ref_list *ref_list = (struct ref_list*)(cb_data);
215 struct ref_item *newitem;
218 - int kind = REF_UNKNOWN_TYPE;
216 + int kind;
217 int len;
218 static struct commit_list branch;
219
@@ -226,10 +224,8 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
224 } else if (!prefixcmp(refname, "refs/remotes/")) {
225 kind = REF_REMOTE_BRANCH;
226 refname += 13;
229 - } else if (!prefixcmp(refname, "refs/tags/")) {
230 - kind = REF_TAG;
231 - refname += 10;
232 - }
227 + } else
228 + return 0;
229
230 /* Filter with with_commit if specified */
231 if (!has_commit(sha1, ref_list->with_commit))