Fix incorrect ref namespace check
The reason why the trailing slash is needed is obvious. refs/stash and HEAD are not namespace, but complete refs. Do full string compare on them. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
8311158c66
commit
97ba642bcf
@ -119,9 +119,9 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
|
||||
type = DECORATION_REF_REMOTE;
|
||||
else if (!prefixcmp(refname, "refs/tags/"))
|
||||
type = DECORATION_REF_TAG;
|
||||
else if (!prefixcmp(refname, "refs/stash"))
|
||||
else if (!strcmp(refname, "refs/stash"))
|
||||
type = DECORATION_REF_STASH;
|
||||
else if (!prefixcmp(refname, "HEAD"))
|
||||
else if (!strcmp(refname, "HEAD"))
|
||||
type = DECORATION_REF_HEAD;
|
||||
|
||||
if (!cb_data || *(int *)cb_data == DECORATE_SHORT_REFS)
|
||||
|
Reference in New Issue
Block a user