git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
BHBenny Halevy <benny@tonian.com>
Date
Sep 26, 2011, 13:53 UTC
Message-ID
<1317045186-25206-1-git-send-email-benny@tonian.com>
From: Benny Halevy <bhalevy@tonian.com>
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 <bhalevy@tonian.com>
---

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
Next: Junio C Hamano
Message 1 of 5 in “git-remote rename should match whole string when renaming remote ref directory”
  1. git-remote rename should match whole string when renaming remote ref directoryBenny Halevy, Sep 26, 2011
  2. Junio C HamanoSep 26, 2011
  3. Benny HalevySep 27, 2011
  4. Junio C HamanoSep 27, 2011
  5. Benny HalevySep 27, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.