branch: update warning message shown when copying a misnamed branch
[gitweb.git] / t / t1402-check-ref-format.sh
index 0790edf60de2d0324ea4752087f03db1113d822e..98e4a8613ba8ab4aebe99360e89c21be2ce3473d 100755 (executable)
@@ -144,6 +144,11 @@ test_expect_success "check-ref-format --branch @{-1}" '
        refname2=$(git check-ref-format --branch @{-2}) &&
        test "$refname2" = master'
 
+test_expect_success 'check-ref-format --branch -naster' '
+       test_must_fail git check-ref-format --branch -naster >actual &&
+       test_must_be_empty actual
+'
+
 test_expect_success 'check-ref-format --branch from subdir' '
        mkdir subdir &&
 
@@ -161,6 +166,17 @@ test_expect_success 'check-ref-format --branch from subdir' '
        test "$refname" = "$sha1"
 '
 
+test_expect_success 'check-ref-format --branch @{-1} from non-repo' '
+       nongit test_must_fail git check-ref-format --branch @{-1} >actual &&
+       test_must_be_empty actual
+'
+
+test_expect_success 'check-ref-format --branch master from non-repo' '
+       echo master >expect &&
+       nongit git check-ref-format --branch master >actual &&
+       test_cmp expect actual
+'
+
 valid_ref_normalized() {
        prereq=
        case $1 in