Skip to content

Commit

Permalink
tests: fix test_commit() for case insensitive filesystems
Browse files Browse the repository at this point in the history
Brian Gernhardt noticed that t3411 was broken recently on case insensitive
filesystems.

0088496 (test-lib.sh: introduce test_commit() and test_merge() helpers,
2009-01-27) used a tag and a file with the same name, only different in
case, and converted many existing tests that needed only a file (or a
tag).

Some tests may want to refer to a rev or a file, but on a filesystem that
loses cases, referring to either without disambiguation mark ("--") on the
command line now triggers an error (t3411 was the only one such test).

Fix it by using a filename that is different from the tagname each step
creates.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Feb 4, 2009
1 parent 61d8660 commit e656fc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ test_tick () {
# Both <file> and <contents> default to <message>.

test_commit () {
file=${2:-$(echo "$1" | tr 'A-Z' 'a-z')}
file=${2:-"$1.t"}
echo "${3-$1}" > "$file" &&
git add "$file" &&
test_tick &&
Expand Down

0 comments on commit e656fc9

Please sign in to comment.