From: Nguyễn Thái Ngọc Duy Date: Thu, 18 Aug 2011 12:29:34 +0000 (+0700) Subject: decoration: do not mis-decorate refs with same prefix X-Git-Tag: v1.7.7-rc1~34^2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=594ffe80e7827b20335c5c6dde2cf57c9919db68;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/log-tree.c b/log-tree.c index e9457019d..344f7347c 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;