Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 1f9a5e9

Browse files
artagnongitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 55cfde2 commit 1f9a5e9

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

t/t5505-remote.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -769,27 +769,41 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
769769
)
770770
'
771771

772-
test_expect_success 'remote prune to cause a dangling symref' '
772+
test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)' '
773773
git clone one seven &&
774+
(
775+
cd seven &&
776+
git remote rm origin &&
777+
echo "quux#foom" > .git/branches/origin &&
778+
git remote rename origin origin &&
779+
test_path_is_missing .git/branches/origin &&
780+
test "$(git config remote.origin.url)" = "quux" &&
781+
test "$(git config remote.origin.fetch)" = "refs/heads/foom:refs/heads/origin"
782+
test "$(git config remote.origin.push)" = "HEAD:refs/heads/foom"
783+
)
784+
'
785+
786+
test_expect_success 'remote prune to cause a dangling symref' '
787+
git clone one eight &&
774788
(
775789
cd one &&
776790
git checkout side2 &&
777791
git branch -D master
778792
) &&
779793
(
780-
cd seven &&
794+
cd eight &&
781795
git remote prune origin
782796
) >err 2>&1 &&
783797
test_i18ngrep "has become dangling" err &&
784798
785799
: And the dangling symref will not cause other annoying errors &&
786800
(
787-
cd seven &&
801+
cd eight &&
788802
git branch -a
789803
) 2>err &&
790804
! grep "points nowhere" err &&
791805
(
792-
cd seven &&
806+
cd eight &&
793807
test_must_fail git branch nomore origin
794808
) 2>err &&
795809
grep "dangling symref" err

0 commit comments

Comments
 (0)