summaryrefslogtreecommitdiff
path: root/t/t2010-checkout-ambiguous.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t2010-checkout-ambiguous.sh')
-rwxr-xr-xt/t2010-checkout-ambiguous.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/t2010-checkout-ambiguous.sh b/t/t2010-checkout-ambiguous.sh
index 87bdf9c96b..2e47fe01cf 100755
--- a/t/t2010-checkout-ambiguous.sh
+++ b/t/t2010-checkout-ambiguous.sh
@@ -41,6 +41,15 @@ test_expect_success 'check ambiguity' '
test_must_fail git checkout world all
'
+test_expect_success 'check ambiguity in subdir' '
+ mkdir sub &&
+ # not ambiguous because sub/world does not exist
+ git -C sub checkout world ../all &&
+ echo hello >sub/world &&
+ # ambiguous because sub/world does exist
+ test_must_fail git -C sub checkout world ../all
+'
+
test_expect_success 'disambiguate checking out from a tree-ish' '
echo bye > world &&
git checkout world -- world &&
@@ -49,7 +58,7 @@ test_expect_success 'disambiguate checking out from a tree-ish' '
test_expect_success 'accurate error message with more than one ref' '
test_must_fail git checkout HEAD master -- 2>actual &&
- grep 2 actual &&
+ test_i18ngrep 2 actual &&
test_i18ngrep "one reference expected, 2 given" actual
'