summaryrefslogtreecommitdiff
path: root/t/t5505-remote.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-26 21:37:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-26 21:37:09 (GMT)
commitae2f25542ffdd1919b33c8f274f8172e49d64dbf (patch)
tree0ab622542d3787b56ac6aae7b9d4f3977a701e7a /t/t5505-remote.sh
parent56f37fda511e1615dc6df86c68f3b841711a7828 (diff)
parenta31eeae27f38246ba35000fa603d884cdd1a81ae (diff)
downloadgit-ae2f25542ffdd1919b33c8f274f8172e49d64dbf.zip
git-ae2f25542ffdd1919b33c8f274f8172e49d64dbf.tar.gz
git-ae2f25542ffdd1919b33c8f274f8172e49d64dbf.tar.bz2
Merge branch 'tg/git-remote'
The internal API to interact with "remote.*" configuration variables has been streamlined. * tg/git-remote: remote: use remote_is_configured() for add and rename remote: actually check if remote exits remote: simplify remote_is_configured() remote: use parse_config_key
Diffstat (limited to 't/t5505-remote.sh')
-rwxr-xr-xt/t5505-remote.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 0dcc752..949725e 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -144,6 +144,39 @@ test_expect_success 'remove remote protects local branches' '
)
'
+test_expect_success 'remove errors out early when deleting non-existent branch' '
+ (
+ cd test &&
+ echo "fatal: No such remote: foo" >expect &&
+ test_must_fail git remote rm foo 2>actual &&
+ test_i18ncmp expect actual
+ )
+'
+
+test_expect_success 'rename errors out early when deleting non-existent branch' '
+ (
+ cd test &&
+ echo "fatal: No such remote: foo" >expect &&
+ test_must_fail git remote rename foo bar 2>actual &&
+ test_i18ncmp expect actual
+ )
+'
+
+test_expect_success 'add existing foreign_vcs remote' '
+ test_config remote.foo.vcs bar &&
+ echo "fatal: remote foo already exists." >expect &&
+ test_must_fail git remote add foo bar 2>actual &&
+ test_i18ncmp expect actual
+'
+
+test_expect_success 'add existing foreign_vcs remote' '
+ test_config remote.foo.vcs bar &&
+ test_config remote.bar.vcs bar &&
+ echo "fatal: remote bar already exists." >expect &&
+ test_must_fail git remote rename foo bar 2>actual &&
+ test_i18ncmp expect actual
+'
+
cat >test/expect <<EOF
* remote origin
Fetch URL: $(pwd)/one