Skip to content

Commit 0f31d68

Browse files
committed
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 <[email protected]>
1 parent 47629dc commit 0f31d68

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

builtin-branch.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ static const char * const builtin_branch_usage[] = {
2222
NULL
2323
};
2424

25-
#define REF_UNKNOWN_TYPE 0x00
2625
#define REF_LOCAL_BRANCH 0x01
2726
#define REF_REMOTE_BRANCH 0x02
28-
#define REF_TAG 0x04
2927

3028
static const char *head;
3129
static unsigned char head_sha1[20];
@@ -215,7 +213,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
215213
{
216214
struct ref_list *ref_list = (struct ref_list*)(cb_data);
217215
struct ref_item *newitem;
218-
int kind = REF_UNKNOWN_TYPE;
216+
int kind;
219217
int len;
220218
static struct commit_list branch;
221219

@@ -226,10 +224,8 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
226224
} else if (!prefixcmp(refname, "refs/remotes/")) {
227225
kind = REF_REMOTE_BRANCH;
228226
refname += 13;
229-
} else if (!prefixcmp(refname, "refs/tags/")) {
230-
kind = REF_TAG;
231-
refname += 10;
232-
}
227+
} else
228+
return 0;
233229

234230
/* Filter with with_commit if specified */
235231
if (!has_commit(sha1, ref_list->with_commit))

0 commit comments

Comments
 (0)