From 1f9a5e905e56502097eb9097a6ea2e9b9cb2e168 Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Sat, 22 Jun 2013 13:28:13 +0530 Subject: [PATCH] t/t5505-remote: test url-with-# in branches-file Add one more test similar to "migrate a remote from named file in $GIT_DIR/branches" to check that a url with a # can be used to specify the branch name (as opposed to the constant "master"). Signed-off-by: Ramkumar Ramachandra Signed-off-by: Junio C Hamano --- t/t5505-remote.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index 396a8133a7..b910f540ed 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -769,27 +769,41 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' ' ) ' -test_expect_success 'remote prune to cause a dangling symref' ' +test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)' ' git clone one seven && ( + cd seven && + git remote rm origin && + echo "quux#foom" > .git/branches/origin && + git remote rename origin origin && + test_path_is_missing .git/branches/origin && + test "$(git config remote.origin.url)" = "quux" && + test "$(git config remote.origin.fetch)" = "refs/heads/foom:refs/heads/origin" + test "$(git config remote.origin.push)" = "HEAD:refs/heads/foom" + ) +' + +test_expect_success 'remote prune to cause a dangling symref' ' + git clone one eight && + ( cd one && git checkout side2 && git branch -D master ) && ( - cd seven && + cd eight && git remote prune origin ) >err 2>&1 && test_i18ngrep "has become dangling" err && : And the dangling symref will not cause other annoying errors && ( - cd seven && + cd eight && git branch -a ) 2>err && ! grep "points nowhere" err && ( - cd seven && + cd eight && test_must_fail git branch nomore origin ) 2>err && grep "dangling symref" err -- 2.11.4.GIT