aboutsummaryrefslogtreecommitdiff
path: root/builtin-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-07-23 14:52:47 -0700
committerJunio C Hamano <gitster@pobox.com>2008-07-23 16:57:03 -0700
commit0f31d68030752b0c1e02a1a092c18094a98202f0 (patch)
tree48f7ec96df8ba1d2f6aa46bc0916b3a37d0f5460 /builtin-branch.c
parent47629dcff0fc75d58f9319d221a78934358e4ef8 (diff)
downloadgit-0f31d68030752b0c1e02a1a092c18094a98202f0.tar.gz
git-0f31d68030752b0c1e02a1a092c18094a98202f0.tar.xz
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>
Diffstat (limited to 'builtin-branch.c')
-rw-r--r--builtin-branch.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/builtin-branch.c b/builtin-branch.c
index b885bd132..3708a50eb 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -22,10 +22,8 @@ static const char * const builtin_branch_usage[] = {
NULL
};
-#define REF_UNKNOWN_TYPE 0x00
#define REF_LOCAL_BRANCH 0x01
#define REF_REMOTE_BRANCH 0x02
-#define REF_TAG 0x04
static const char *head;
static unsigned char head_sha1[20];
@@ -215,7 +213,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
{
struct ref_list *ref_list = (struct ref_list*)(cb_data);
struct ref_item *newitem;
- int kind = REF_UNKNOWN_TYPE;
+ int kind;
int len;
static struct commit_list branch;
@@ -226,10 +224,8 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
} else if (!prefixcmp(refname, "refs/remotes/")) {
kind = REF_REMOTE_BRANCH;
refname += 13;
- } else if (!prefixcmp(refname, "refs/tags/")) {
- kind = REF_TAG;
- refname += 10;
- }
+ } else
+ return 0;
/* Filter with with_commit if specified */
if (!has_commit(sha1, ref_list->with_commit))