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 <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ramkumar Ramachandra 2013-06-22 13:28:13 +05:30 committed by Junio C Hamano
parent 55cfde251b
commit 1f9a5e905e

View file

@ -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