Browse Source
An earlier update to show the location of working tree in the error message did not consider the possibility that a git command may be run in a bare repository, which has been corrected. * es/outside-repo-errmsg-hints: prefix_path: show gitdir if worktree unavailablemaint
![gitster@pobox.com](/assets/img/avatar_default.png)
3 changed files with 50 additions and 4 deletions
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh |
||||
|
||||
test_description='diagnosing out-of-scope pathspec' |
||||
|
||||
. ./test-lib.sh |
||||
|
||||
test_expect_success 'setup a bare and non-bare repository' ' |
||||
test_commit file1 && |
||||
git clone --bare . bare |
||||
' |
||||
|
||||
test_expect_success 'log and ls-files in a bare repository' ' |
||||
( |
||||
cd bare && |
||||
test_must_fail git log -- .. >out 2>err && |
||||
test_must_be_empty out && |
||||
test_i18ngrep "outside repository" err && |
||||
|
||||
test_must_fail git ls-files -- .. >out 2>err && |
||||
test_must_be_empty out && |
||||
test_i18ngrep "outside repository" err |
||||
) |
||||
' |
||||
|
||||
test_expect_success 'log and ls-files in .git directory' ' |
||||
( |
||||
cd .git && |
||||
test_must_fail git log -- .. >out 2>err && |
||||
test_must_be_empty out && |
||||
test_i18ngrep "outside repository" err && |
||||
|
||||
test_must_fail git ls-files -- .. >out 2>err && |
||||
test_must_be_empty out && |
||||
test_i18ngrep "outside repository" err |
||||
) |
||||
' |
||||
|
||||
test_done |
Loading…
Reference in new issue