Skip to content

Commit

Permalink
decoration: do not mis-decorate refs with same prefix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Aug 18, 2011
1 parent f696543 commit 594ffe8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions log-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 594ffe8

Please sign in to comment.