summaryrefslogtreecommitdiff
path: root/builtin-remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-09 07:27:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-02-11 06:26:20 (GMT)
commitf8948e2fbc7fbd63e81006408965e3e89380bfaa (patch)
treee431c958f2c07b7da331d985f96d81267c75e20a /builtin-remote.c
parent8ea7ad694be942350457197357127ed81b2550fe (diff)
downloadgit-f8948e2fbc7fbd63e81006408965e3e89380bfaa.zip
git-f8948e2fbc7fbd63e81006408965e3e89380bfaa.tar.gz
git-f8948e2fbc7fbd63e81006408965e3e89380bfaa.tar.bz2
remote prune: warn dangling symrefs
If you prune from the remote "frotz" that deleted the ref your tracking branch remotes/frotz/HEAD points at, the symbolic ref will become dangling. We used to detect this as an error condition and issued a message every time refs are enumerated. This stops the error message, but moves the warning to "remote prune". Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-remote.c')
-rw-r--r--builtin-remote.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin-remote.c b/builtin-remote.c
index db18bcf..ac69d37 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -756,12 +756,17 @@ static int prune(int argc, const char **argv)
OPT_END()
};
struct ref_states states;
+ const char *dangling_msg;
argc = parse_options(argc, argv, options, builtin_remote_usage, 0);
if (argc < 1)
usage_with_options(builtin_remote_usage, options);
+ dangling_msg = (dry_run
+ ? " %s will become dangling!\n"
+ : " %s has become dangling!\n");
+
memset(&states, 0, sizeof(states));
for (; argc; argc--, argv++) {
int i;
@@ -784,6 +789,7 @@ static int prune(int argc, const char **argv)
printf(" * [%s] %s\n", dry_run ? "would prune" : "pruned",
abbrev_ref(refname, "refs/remotes/"));
+ warn_dangling_symref(dangling_msg, refname);
}
/* NEEDSWORK: free remote */