Skip to content

Commit 02a20d1

Browse files
committed
Merge branch 'nd/maint-refname-in-hierarchy-check'
* nd/maint-refname-in-hierarchy-check: Fix incorrect ref namespace check
2 parents 77cdf0f + 97ba642 commit 02a20d1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

builtin/fetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ static void find_non_local_tags(struct transport *transport,
585585

586586
for_each_ref(add_existing, &existing_refs);
587587
for (ref = transport_get_remote_refs(transport); ref; ref = ref->next) {
588-
if (prefixcmp(ref->name, "refs/tags"))
588+
if (prefixcmp(ref->name, "refs/tags/"))
589589
continue;
590590

591591
/*

builtin/remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static int add_branch_for_removal(const char *refname,
534534
}
535535

536536
/* don't delete non-remote-tracking refs */
537-
if (prefixcmp(refname, "refs/remotes")) {
537+
if (prefixcmp(refname, "refs/remotes/")) {
538538
/* advise user how to delete local branches */
539539
if (!prefixcmp(refname, "refs/heads/"))
540540
string_list_append(branches->skipped,

log-tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
120120
type = DECORATION_REF_REMOTE;
121121
else if (!prefixcmp(refname, "refs/tags/"))
122122
type = DECORATION_REF_TAG;
123-
else if (!prefixcmp(refname, "refs/stash"))
123+
else if (!strcmp(refname, "refs/stash"))
124124
type = DECORATION_REF_STASH;
125-
else if (!prefixcmp(refname, "HEAD"))
125+
else if (!strcmp(refname, "HEAD"))
126126
type = DECORATION_REF_HEAD;
127127

128128
if (!cb_data || *(int *)cb_data == DECORATE_SHORT_REFS)

0 commit comments

Comments
 (0)