summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-07-11 12:45:49 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-07-11 12:45:49 -0700
commit9ca724933a8d50633699acf3e5731fa392e2ff36 (patch)
tree3aacdf358feb1e0bf564b8e0a62c31b8231c8d8e /t
parentMerge branch 'cn/cherry-pick-range-docs' into maint (diff)
parentverify_filename(): ask the caller to chose the kind of diagnosis (diff)
downloadtgif-9ca724933a8d50633699acf3e5731fa392e2ff36.tar.xz
Merge branch 'mm/verify-filename-fix' into maint
"git diff COPYING HEAD:COPYING" gave a nonsense error message that claimed that the treeish HEAD did not have COPYING in it. * mm/verify-filename-fix: verify_filename(): ask the caller to chose the kind of diagnosis sha1_name: do not trigger detailed diagnosis for file arguments
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