summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 47629dc)
raw | patch | inline | side by side (parent: 47629dc)
author | Junio C Hamano <gitster@pobox.com> | |
Wed, 23 Jul 2008 21:52:47 +0000 (14:52 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 23 Jul 2008 23:57:03 +0000 (16:57 -0700) |
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>
ever interested in local or remote tracking branches.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-branch.c | patch | blob | history |
diff --git a/builtin-branch.c b/builtin-branch.c
index b885bd132b5e5b2979afd451f4e81f184ec9c969..3708a50ebead093f54b7f5c837b0390a8d8b76e0 100644 (file)
--- a/builtin-branch.c
+++ b/builtin-branch.c
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))