Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-27 00:37:09 +0300
committerJunio C Hamano <gitster@pobox.com>2016-02-27 00:37:09 +0300
commitae2f25542ffdd1919b33c8f274f8172e49d64dbf (patch)
tree0ab622542d3787b56ac6aae7b9d4f3977a701e7a /t/t5505-remote.sh
parent56f37fda511e1615dc6df86c68f3b841711a7828 (diff)
parenta31eeae27f38246ba35000fa603d884cdd1a81ae (diff)
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 0dcc752076..949725e9bc 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