aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-08 23:27:10 -0800
committerJunio C Hamano <gitster@pobox.com>2009-02-10 22:26:20 -0800
commitf8948e2fbc7fbd63e81006408965e3e89380bfaa (patch)
treee431c958f2c07b7da331d985f96d81267c75e20a /t
parent8ea7ad694be942350457197357127ed81b2550fe (diff)
downloadgit-f8948e2fbc7fbd63e81006408965e3e89380bfaa.tar.gz
git-f8948e2fbc7fbd63e81006408965e3e89380bfaa.tar.xz
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 't')
-rwxr-xr-xt/t5505-remote.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index bc5b7ce4a..2067dc558 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -402,4 +402,25 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
test "$(git config remote.origin.fetch)" = "refs/heads/master:refs/heads/origin")
'
+test_expect_success 'remote prune to cause a dangling symref' '
+ git clone one seven &&
+ (
+ cd one &&
+ git checkout side2 &&
+ git branch -D master
+ ) &&
+ (
+ cd seven &&
+ git remote prune origin
+ ) 2>err &&
+ grep "has become dangling" err &&
+
+ : And the dangling symref will not cause other annoying errors
+ (
+ cd seven &&
+ git branch -a
+ ) 2>err &&
+ ! grep "points nowhere" err
+'
+
test_done