git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benny Halevy <benny@tonian.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Benny Halevy <bhalevy@tonian.com>
Subject: [PATCH] git-remote rename should match whole string when renaming remote ref directory
Date: Mon, 26 Sep 2011 16:53:06 +0300	[thread overview]
Message-ID: <1317045186-25206-1-git-send-email-benny@tonian.com> (raw)

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

             reply	other threads:[~2011-09-26 13:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26 13:53 Benny Halevy [this message]
2011-09-26 18:04 ` [PATCH] git-remote rename should match whole string when renaming remote ref directory Junio C Hamano
2011-09-27  2:45   ` Benny Halevy
2011-09-27  6:07     ` Junio C Hamano
2011-09-27  9:38       ` Benny Halevy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317045186-25206-1-git-send-email-benny@tonian.com \
    --to=benny@tonian.com \
    --cc=bhalevy@tonian.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).