summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8311158)
raw | patch | inline | side by side (parent: 8311158)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Thu, 5 Jan 2012 12:39:40 +0000 (19:39 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 11 Jan 2012 20:52:12 +0000 (12:52 -0800) |
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>
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>
builtin/fetch.c | patch | blob | history | |
builtin/remote.c | patch | blob | history | |
log-tree.c | patch | blob | history |
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 8761a33b491ae8a9437d78247ef0808c0686486e..ea45cb0e8ed2b1b27ed709182ea9bcd271c91dae 100644 (file)
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
for_each_ref(add_existing, &existing_refs);
for (ref = transport_get_remote_refs(transport); ref; ref = ref->next) {
- if (prefixcmp(ref->name, "refs/tags"))
+ if (prefixcmp(ref->name, "refs/tags/"))
continue;
/*
diff --git a/builtin/remote.c b/builtin/remote.c
index c810643815e38f4ada805e2af49973e4e0051801..164626b1d1a82a4b01c2c5ea58e7ac3ed49a8c17 100644 (file)
--- a/builtin/remote.c
+++ b/builtin/remote.c
}
/* don't delete non-remote-tracking refs */
- if (prefixcmp(refname, "refs/remotes")) {
+ if (prefixcmp(refname, "refs/remotes/")) {
/* advise user how to delete local branches */
if (!prefixcmp(refname, "refs/heads/"))
string_list_append(branches->skipped,
diff --git a/log-tree.c b/log-tree.c
index e7694a3a4ca2e6de7fe8f3b5458eb2b65591373a..21ac9047c0a9fd635e2257792eef64b6e580da27 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
@@ -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)