Skip to content

Commit 594ffe8

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f696543 commit 594ffe8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

log-tree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
9595
if (!obj)
9696
return 0;
9797

98-
if (!prefixcmp(refname, "refs/heads"))
98+
if (!prefixcmp(refname, "refs/heads/"))
9999
type = DECORATION_REF_LOCAL;
100-
else if (!prefixcmp(refname, "refs/remotes"))
100+
else if (!prefixcmp(refname, "refs/remotes/"))
101101
type = DECORATION_REF_REMOTE;
102-
else if (!prefixcmp(refname, "refs/tags"))
102+
else if (!prefixcmp(refname, "refs/tags/"))
103103
type = DECORATION_REF_TAG;
104104
else if (!prefixcmp(refname, "refs/stash"))
105105
type = DECORATION_REF_STASH;

0 commit comments

Comments
 (0)