diff options
author | Ramkumar Ramachandra <artagnon@gmail.com> | 2013-06-22 11:58:13 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-23 11:33:57 +0400 |
commit | 1f9a5e905e56502097eb9097a6ea2e9b9cb2e168 (patch) | |
tree | 7edc10a9392f769e1f202b5616cd530362c932ae /t/t5505-remote.sh | |
parent | 55cfde251b4bee36f64f2067cccc4ba346aaf1b0 (diff) |
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/t5505-remote.sh')
-rwxr-xr-x | t/t5505-remote.sh | 22 |
1 files 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 |