Merge branch 'jx/i18n-branch-error-messages'
[gitweb.git] / t / t3200-branch.sh
index 8311c7da440a5932107cd8e4787f236c29518861..d969f0ecd85a6907f219d141cad2c00c4b5a89f8 100755 (executable)
@@ -409,6 +409,18 @@ test_expect_success '--set-upstream-to fails on detached HEAD' '
        git checkout -
 '
 
+test_expect_success '--set-upstream-to fails on a missing dst branch' '
+       test_must_fail git branch --set-upstream-to master does-not-exist
+'
+
+test_expect_success '--set-upstream-to fails on a missing src branch' '
+       test_must_fail git branch --set-upstream-to does-not-exist master
+'
+
+test_expect_success '--set-upstream-to fails on a non-ref' '
+       test_must_fail git branch --set-upstream-to HEAD^{}
+'
+
 test_expect_success 'use --set-upstream-to modify HEAD' '
        test_config branch.master.remote foo &&
        test_config branch.master.merge foo &&