summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorMartin von Zweigbergk <martin.von.zweigbergk@gmail.com>2011-09-03 15:26:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-09-12 04:39:58 (GMT)
commit1822b86a515af708e2259bae2b6a1f2052a2d3aa (patch)
tree8814478e2490f1bdd2fec2720ca18ea8580fb031 /builtin
parent60e5eee0f1a70e09f28d1e55b3aaddb59eeea887 (diff)
downloadgit-1822b86a515af708e2259bae2b6a1f2052a2d3aa.zip
git-1822b86a515af708e2259bae2b6a1f2052a2d3aa.tar.gz
git-1822b86a515af708e2259bae2b6a1f2052a2d3aa.tar.bz2
remote rename: warn when refspec was not updated
When renaming a remote, we also try to update the fetch refspec accordingly, but only if it has the default format. For others, such as refs/heads/master:refs/heads/origin, we are conservative and leave it untouched. Let's give the user a warning about refspecs that are not updated, so he can manually update the config if necessary. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/remote.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/remote.c b/builtin/remote.c
index 180da89..659c6ab 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -682,6 +682,12 @@ static int mv(int argc, const char **argv)
ptr-buf2.buf + strlen(":refs/remotes/"),
strlen(rename.old), rename.new,
strlen(rename.new));
+ else
+ warning("Not updating non-default fetch respec\n"
+ "\t%s\n"
+ "\tPlease update the configuration manually if necessary.",
+ buf2.buf);
+
if (git_config_set_multivar(buf.buf, buf2.buf, "^$", 0))
return error("Could not append '%s'", buf.buf);
}