summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-08-18 19:29:34 +0700
committerJunio C Hamano <gitster@pobox.com>2011-08-18 10:58:19 -0700
commit594ffe80e7827b20335c5c6dde2cf57c9919db68 (patch)
tree14cc394c98a346708b3cfdeba40f54056960e8be /log-tree.c
parentf696543dad6c7ba27b0c4fab167a5687263a9ba0 (diff)
downloadgit-594ffe80e7827b20335c5c6dde2cf57c9919db68.tar.gz
decoration: do not mis-decorate refs with same prefix
We definitely do not want to decorate refs/headsandtails the same as refs/heads/*, for example. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/log-tree.c b/log-tree.c
index e9457019d5..344f7347cc 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -95,11 +95,11 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
if (!obj)
return 0;
- if (!prefixcmp(refname, "refs/heads"))
+ if (!prefixcmp(refname, "refs/heads/"))
type = DECORATION_REF_LOCAL;
- else if (!prefixcmp(refname, "refs/remotes"))
+ else if (!prefixcmp(refname, "refs/remotes/"))
type = DECORATION_REF_REMOTE;
- else if (!prefixcmp(refname, "refs/tags"))
+ else if (!prefixcmp(refname, "refs/tags/"))
type = DECORATION_REF_TAG;
else if (!prefixcmp(refname, "refs/stash"))
type = DECORATION_REF_STASH;