diff options
Diffstat (limited to 't/t4211-line-log.sh')
-rwxr-xr-x | t/t4211-line-log.sh | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh index e186c83250..85d151423d 100755 --- a/t/t4211-line-log.sh +++ b/t/t4211-line-log.sh @@ -4,11 +4,32 @@ test_description='test log -L' . ./test-lib.sh test_expect_success 'setup (import history)' ' - test_oid_init && git fast-import < "$TEST_DIRECTORY"/t4211/history.export && git reset --hard ' +test_expect_success 'basic command line parsing' ' + # This may fail due to "no such path a.c in commit", or + # "-L is incompatible with pathspec", depending on the + # order the error is checked. Either is acceptable. + test_must_fail git log -L1,1:a.c -- a.c && + + # -L requires there is no pathspec + test_must_fail git log -L1,1:b.c -- b.c 2>error && + test_i18ngrep "cannot be used with pathspec" error && + + # This would fail because --follow wants a single path, but + # we may fail due to incompatibility between -L/--follow in + # the future. Either is acceptable. + test_must_fail git log -L1,1:b.c --follow && + test_must_fail git log --follow -L1,1:b.c && + + # This would fail because -L wants no pathspec, but + # we may fail due to incompatibility between -L/--follow in + # the future. Either is acceptable. + test_must_fail git log --follow -L1,1:b.c -- b.c +' + canned_test_1 () { test_expect_$1 "$2" " git log $2 >actual && |