remote: actually check if remote exits
[gitweb.git] / t / t5505-remote.sh
index 1a8e3b81c815cfb92b7025a12d8c703f2ffc54e9..f1d073f1ba105557c60d4607726eb14dd8510c98 100755 (executable)
@@ -139,6 +139,24 @@ 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
+       )
+'
+
 cat >test/expect <<EOF
 * remote origin
   Fetch URL: $(pwd)/one