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:
parent
8311158c66
commit
97ba642bcf
@ -574,7 +574,7 @@ static void find_non_local_tags(struct transport *transport,
|
|||||||
|
|
||||||
for_each_ref(add_existing, &existing_refs);
|
for_each_ref(add_existing, &existing_refs);
|
||||||
for (ref = transport_get_remote_refs(transport); ref; ref = ref->next) {
|
for (ref = transport_get_remote_refs(transport); ref; ref = ref->next) {
|
||||||
if (prefixcmp(ref->name, "refs/tags"))
|
if (prefixcmp(ref->name, "refs/tags/"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -535,7 +535,7 @@ static int add_branch_for_removal(const char *refname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* don't delete non-remote-tracking refs */
|
/* don't delete non-remote-tracking refs */
|
||||||
if (prefixcmp(refname, "refs/remotes")) {
|
if (prefixcmp(refname, "refs/remotes/")) {
|
||||||
/* advise user how to delete local branches */
|
/* advise user how to delete local branches */
|
||||||
if (!prefixcmp(refname, "refs/heads/"))
|
if (!prefixcmp(refname, "refs/heads/"))
|
||||||
string_list_append(branches->skipped,
|
string_list_append(branches->skipped,
|
||||||
|
@ -119,9 +119,9 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
|
|||||||
type = DECORATION_REF_REMOTE;
|
type = DECORATION_REF_REMOTE;
|
||||||
else if (!prefixcmp(refname, "refs/tags/"))
|
else if (!prefixcmp(refname, "refs/tags/"))
|
||||||
type = DECORATION_REF_TAG;
|
type = DECORATION_REF_TAG;
|
||||||
else if (!prefixcmp(refname, "refs/stash"))
|
else if (!strcmp(refname, "refs/stash"))
|
||||||
type = DECORATION_REF_STASH;
|
type = DECORATION_REF_STASH;
|
||||||
else if (!prefixcmp(refname, "HEAD"))
|
else if (!strcmp(refname, "HEAD"))
|
||||||
type = DECORATION_REF_HEAD;
|
type = DECORATION_REF_HEAD;
|
||||||
|
|
||||||
if (!cb_data || *(int *)cb_data == DECORATE_SHORT_REFS)
|
if (!cb_data || *(int *)cb_data == DECORATE_SHORT_REFS)
|
||||||
|
Loading…
Reference in New Issue
Block a user