summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-06-22 07:58:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-23 07:33:57 (GMT)
commit1f9a5e905e56502097eb9097a6ea2e9b9cb2e168 (patch)
tree7edc10a9392f769e1f202b5616cd530362c932ae /t
parent55cfde251b4bee36f64f2067cccc4ba346aaf1b0 (diff)
downloadgit-1f9a5e905e56502097eb9097a6ea2e9b9cb2e168.zip
git-1f9a5e905e56502097eb9097a6ea2e9b9cb2e168.tar.gz
git-1f9a5e905e56502097eb9097a6ea2e9b9cb2e168.tar.bz2
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>
Diffstat (limited to 't')
-rwxr-xr-xt/t5505-remote.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 396a813..b910f54 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