summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-06-28 15:19:31 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-06-28 15:19:32 -0700
commit08080894b7bd68db413275e601286d94b40752bd (patch)
tree4541a9e47013b90380d18111c97df65d138aaf8b /t
parentMerge branch 'jk/diff-no-index-pager' (diff)
parentverify_filename(): ask the caller to chose the kind of diagnosis (diff)
downloadtgif-08080894b7bd68db413275e601286d94b40752bd.tar.xz
Merge branch 'mm/verify-filename-fix'
"git diff COPYING HEAD:COPYING" gave a nonsense error message that claimed that the treeish HEAD did not have COPYING in it.
Diffstat (limited to 't')
-rwxr-xr-xt/t1506-rev-parse-diagnosis.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index 0843a1c13b..c5cb77a0e1 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -171,4 +171,15 @@ test_expect_success 'relative path when startup_info is NULL' '
grep "BUG: startup_info struct is not initialized." error
'
+test_expect_success '<commit>:file correctly diagnosed after a pathname' '
+ test_must_fail git rev-parse file.txt HEAD:file.txt 1>actual 2>error &&
+ test_i18ngrep ! "exists on disk" error &&
+ test_i18ngrep "no such path in the working tree" error &&
+ cat >expect <<-\EOF &&
+ file.txt
+ HEAD:file.txt
+ EOF
+ test_cmp expect actual
+'
+
test_done