DORMANTno replies

[PATCH] git-remote rename should match whole string when renaming remote ref directory

From: Benny Halevy <hidden>
Date: 2016-06-15 22:52:06
Subsystem: the rest · Maintainer: Linus Torvalds

From: Benny Halevy <redacted>

Otherwise, with two remotes: test, test-2
	git remote rename test test-
ends up with:
	.git/refs/remotes/test-
	.git/refs/remotes/test--2

Signed-off-by: Benny Halevy <redacted>
---

By the way, I also see the old names as empty directories in .git/refs/remotes
not sure if that's a bug or a feature... :)

Benny

 builtin/remote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index f2a9c26..5443e71 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -571,7 +571,7 @@ static int read_remote_branches(const char *refname,
 	const char *symref;
 
 	strbuf_addf(&buf, "refs/remotes/%s", rename->old);
-	if (!prefixcmp(refname, buf.buf)) {
+	if (!strcmp(refname, buf.buf)) {
 		item = string_list_append(rename->remote_branches, xstrdup(refname));
 		symref = resolve_ref(refname, orig_sha1, 1, &flag);
 		if (flag & REF_ISSYMREF)
-- 
1.7.7.rc3.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help