From 4682d8521c3ce9d722bd214fd7d5fc92063fdacb Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 27 Jun 2012 20:14:47 -0700 Subject: diff-index.c: "git diff" has no need to read blob from the standard input Only "diff --no-index -" does. Bolting the logic into the low-level function diff_populate_filespec() was a layering violation from day one. Move populate_from_stdin() function out of the generic diff.c to its only user, diff-index.c. Also make sure "-" from the command line stays a special token "read from the standard input", even if we later decide to sanitize the result from prefix_filename() function in a few obvious ways, e.g. removing unnecessary "./" prefix, duplicated slashes "//" in the middle, etc. Signed-off-by: Junio C Hamano --- t/t7501-commit.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 't') diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index 3ad04363b5..e6cf6ee9e7 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -458,4 +458,16 @@ test_expect_success 'amend can copy notes' ' ' +test_expect_success 'commit a file whose name is a dash' ' + git reset --hard && + for i in 1 2 3 4 5 + do + echo $i + done >./- && + git add ./- && + test_tick && + git commit -m "add dash" >output