Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit d0859cc

Browse files
committed
Merge 'win-tests-rebase'
This branch is meant to replace 'win-tests-fixes', with several commits dropped or modified, as they are (no longer) necessary. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 parents 9d3f42a + 3ed8dae commit d0859cc

19 files changed

+94
-51
lines changed

t/annotate-tests.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -251,27 +251,27 @@ test_expect_success 'blame -L X,-N' '
251251
'
252252

253253
test_expect_success 'blame -L /RE/ (RE to end)' '
254-
check_count -L/evil/ C 1 "A U Thor" 1
254+
check_count -L/\;*evil/ C 1 "A U Thor" 1
255255
'
256256

257257
test_expect_success 'blame -L /RE/,/RE2/' '
258-
check_count -L/robot/,/green/ A 1 B 1 B2 1 D 1 E 1
258+
check_count -L/\;*robot/,/\;*green/ A 1 B 1 B2 1 D 1 E 1
259259
'
260260

261261
test_expect_success 'blame -L X,/RE/' '
262-
check_count -L5,/evil/ B1 1 D 1 "A U Thor" 1
262+
check_count -L5,/\;*evil/ B1 1 D 1 "A U Thor" 1
263263
'
264264

265265
test_expect_success 'blame -L /RE/,Y' '
266-
check_count -L/99/,7 B1 1 D 1 "A U Thor" 1
266+
check_count -L/\;*99/,7 B1 1 D 1 "A U Thor" 1
267267
'
268268

269269
test_expect_success 'blame -L /RE/,+N' '
270-
check_count -L/99/,+3 B1 1 D 1 "A U Thor" 1
270+
check_count -L/\;*99/,+3 B1 1 D 1 "A U Thor" 1
271271
'
272272

273273
test_expect_success 'blame -L /RE/,-N' '
274-
check_count -L/99/,-3 B 1 B2 1 D 1
274+
check_count -L/\;*99/,-3 B 1 B2 1 D 1
275275
'
276276

277277
# 'file' ends with an incomplete line, so 'wc' reports one fewer lines than
@@ -337,31 +337,31 @@ test_expect_success 'blame -L multiple (superset/subset: unordered)' '
337337
'
338338

339339
test_expect_success 'blame -L /RE/ (relative)' '
340-
check_count -L3,3 -L/fox/ B1 1 B2 1 C 1 D 1 "A U Thor" 1
340+
check_count -L3,3 -L/\;*fox/ B1 1 B2 1 C 1 D 1 "A U Thor" 1
341341
'
342342

343343
test_expect_success 'blame -L /RE/ (relative: no preceding range)' '
344-
check_count -L/dog/ A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1
344+
check_count -L/\;*dog/ A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1
345345
'
346346

347347
test_expect_success 'blame -L /RE/ (relative: adjacent)' '
348-
check_count -L1,1 -L/dog/,+1 A 1 E 1
348+
check_count -L1,1 -L/\;*dog/,+1 A 1 E 1
349349
'
350350

351351
test_expect_success 'blame -L /RE/ (relative: not found)' '
352-
test_must_fail $PROG -L4,4 -L/dog/ file
352+
test_must_fail $PROG -L4,4 -L/\;*dog/ file
353353
'
354354

355355
test_expect_success 'blame -L /RE/ (relative: end-of-file)' '
356356
test_must_fail $PROG -L, -L/$/ file
357357
'
358358

359359
test_expect_success 'blame -L ^/RE/ (absolute)' '
360-
check_count -L3,3 -L^/dog/,+2 A 1 B2 1
360+
check_count -L3,3 -L^/\;*dog/,+2 A 1 B2 1
361361
'
362362

363363
test_expect_success 'blame -L ^/RE/ (absolute: no preceding range)' '
364-
check_count -L^/dog/,+2 A 1 B2 1
364+
check_count -L^/\;*dog/,+2 A 1 B2 1
365365
'
366366

367367
test_expect_success 'blame -L ^/RE/ (absolute: not found)' '

t/t0008-ignores.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ test_description=check-ignore
55
. ./test-lib.sh
66

77
init_vars () {
8-
global_excludes="$(pwd)/global-excludes"
8+
# On Windows, avoid using "C:" in the global-excludes paths.
9+
if test_have_prereq MINGW
10+
then
11+
global_excludes="global-excludes"
12+
else
13+
global_excludes="$(pwd)/global-excludes"
14+
fi
915
}
1016

1117
enable_global_excludes () {

t/t0081-line-buffer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' '
2929
test_cmp expect actual
3030
'
3131

32-
test_expect_success 'read from file descriptor' '
32+
test_expect_success NOT_MINGW 'read from file descriptor' '
3333
rm -f input &&
3434
echo hello >expect &&
3535
echo hello >input &&

t/t0110-urlmatch-normalization.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ test_expect_success 'url general escapes' '
117117
test "$(test-urlmatch-normalization -p "X://W?'\!'")" = "x://w/?'\!'"
118118
'
119119

120-
test_expect_success 'url high-bit escapes' '
120+
test_expect_success !MINGW 'url high-bit escapes' '
121121
test "$(test-urlmatch-normalization -p "$(cat "$tu-1")")" = "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12" &&
122122
test "$(test-urlmatch-normalization -p "$(cat "$tu-2")")" = "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F" &&
123123
test "$(test-urlmatch-normalization -p "$(cat "$tu-3")")" = "x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F" &&

t/t1050-large.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ test_expect_success setup '
99
# clone does not allow us to pass core.bigfilethreshold to
1010
# new repos, so set core.bigfilethreshold globally
1111
git config --global core.bigfilethreshold 200k &&
12-
echo X | dd of=large1 bs=1k seek=2000 &&
13-
echo X | dd of=large2 bs=1k seek=2000 &&
14-
echo X | dd of=large3 bs=1k seek=2000 &&
15-
echo Y | dd of=huge bs=1k seek=2500 &&
12+
perl -e "print \"\\0\" x 2048000; print \"X\\n\";" > large1 &&
13+
perl -e "print \"\\0\" x 2048000; print \"X\\n\";" > large2 &&
14+
perl -e "print \"\\0\" x 2048000; print \"X\\n\";" > large3 &&
15+
perl -e "print \"\\0\" x 2560000; print \"Y\\n\";" > huge &&
1616
GIT_ALLOC_LIMIT=1500 &&
1717
export GIT_ALLOC_LIMIT
1818
'

t/t1501-worktree.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ test_expect_success 'make_relative_path handles double slashes in GIT_DIR' '
339339
git --git-dir="$(pwd)//repo.git" --work-tree="$(pwd)" add dummy_file
340340
'
341341

342+
test_have_prereq MINGW &&
343+
# make sure to test DOS path on Windows
344+
TRASH_DIRECTORY="$(cd "$TRASH_DIRECTORY" && pwd)"
345+
342346
test_expect_success 'relative $GIT_WORK_TREE and git subprocesses' '
343347
GIT_DIR=repo.git GIT_WORK_TREE=repo.git/work \
344348
test-subprocess --setup-work-tree rev-parse --show-toplevel >actual &&

t/t3102-ls-tree-wildcards.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ test_description='ls-tree with(out) globs'
44

55
. ./test-lib.sh
66

7-
test_expect_success 'setup' '
7+
test_expect_success NOT_MINGW 'setup' '
88
mkdir a aa "a[a]" &&
99
touch a/one aa/two "a[a]/three" &&
1010
git add a/one aa/two "a[a]/three" &&
1111
git commit -m test
1212
'
1313

14-
test_expect_success 'ls-tree a[a] matches literally' '
14+
test_expect_success NOT_MINGW 'ls-tree a* matches literally' '
1515
cat >expected <<EOF &&
1616
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a[a]/three
1717
EOF

t/t3901-i18n-patch.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ test_expect_success setup '
5454
git add yours &&
5555
git commit -s -m "Second on side" &&
5656
57-
# the second one on the side branch is ISO-8859-1
58-
git config i18n.commitencoding ISO8859-1 &&
59-
# use author and committer name in ISO-8859-1 to match it.
60-
. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
57+
if test_have_prereq NOT_MINGW
58+
then
59+
# the second one on the side branch is ISO-8859-1
60+
git config i18n.commitencoding ISO8859-1 &&
61+
# use author and committer name in ISO-8859-1 to match it.
62+
. "$TEST_DIRECTORY"/t3901-8859-1.txt
63+
fi &&
6164
test_tick &&
6265
echo Yet another >theirs &&
6366
git add theirs &&
@@ -119,7 +122,7 @@ test_expect_success 'rebase (U/L)' '
119122
check_encoding 2
120123
'
121124

122-
test_expect_success 'rebase (L/L)' '
125+
test_expect_success NOT_MINGW 'rebase (L/L)' '
123126
# In this test we want ISO-8859-1 encoded commits as the result
124127
git config i18n.commitencoding ISO8859-1 &&
125128
git config i18n.logoutputencoding ISO8859-1 &&
@@ -131,7 +134,7 @@ test_expect_success 'rebase (L/L)' '
131134
check_encoding 2 8859
132135
'
133136

134-
test_expect_success 'rebase (L/U)' '
137+
test_expect_success NOT_MINGW 'rebase (L/U)' '
135138
# This is pathological -- use UTF-8 as intermediate form
136139
# to get ISO-8859-1 results.
137140
git config i18n.commitencoding ISO8859-1 &&
@@ -159,7 +162,7 @@ test_expect_success 'cherry-pick(U/U)' '
159162
check_encoding 3
160163
'
161164

162-
test_expect_success 'cherry-pick(L/L)' '
165+
test_expect_success NOT_MINGW 'cherry-pick(L/L)' '
163166
# Both the commitencoding and logoutputencoding is set to ISO-8859-1
164167
165168
git config i18n.commitencoding ISO8859-1 &&
@@ -189,7 +192,7 @@ test_expect_success 'cherry-pick(U/L)' '
189192
check_encoding 3
190193
'
191194

192-
test_expect_success 'cherry-pick(L/U)' '
195+
test_expect_success NOT_MINGW 'cherry-pick(L/U)' '
193196
# Again, the commitencoding is set to ISO-8859-1 but
194197
# logoutputencoding is set to UTF-8.
195198

t/t4041-diff-submodule-option.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ add_file () {
2323
echo "$name" >"$name" &&
2424
git add "$name" &&
2525
test_tick &&
26-
msg_added_iso88591=$(echo "Add $name ($added $name)" | iconv -f utf-8 -t iso8859-1) &&
27-
git -c 'i18n.commitEncoding=iso8859-1' commit -m "$msg_added_iso88591"
26+
# "git commit -m" would break MinGW, as Windows refuse to pass
27+
# iso8859-1 encoded parameter to git.
28+
echo "Add $name ($added $name)" | iconv -f utf-8 -t iso8859-1 |
29+
git -c 'i18n.commitEncoding=iso8859-1' commit -F -
2830
done >/dev/null &&
2931
git rev-parse --short --verify HEAD
3032
)

t/t4201-shortlog.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '
9393
test_cmp expect log.predictable
9494
'
9595

96-
test_expect_success 'shortlog wrapping' '
96+
test_expect_success NOT_MINGW 'shortlog wrapping' '
9797
cat >expect <<\EOF &&
9898
A U Thor (5):
9999
Test
@@ -114,7 +114,7 @@ EOF
114114
test_cmp expect out
115115
'
116116

117-
test_expect_success 'shortlog from non-git directory' '
117+
test_expect_success NOT_MINGW 'shortlog from non-git directory' '
118118
git log HEAD >log &&
119119
GIT_DIR=non-existing git shortlog -w <log >out &&
120120
test_cmp expect out
@@ -159,7 +159,7 @@ $DSCHO (2):
159159
160160
EOF
161161

162-
test_expect_success 'shortlog encoding' '
162+
test_expect_success NOT_MINGW 'shortlog encoding' '
163163
git reset --hard "$commit" &&
164164
git config --unset i18n.commitencoding &&
165165
echo 2 > a1 &&

t/t4205-log-pretty-formats.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test_expect_success 'set up basic repos' '
2828
git add foo &&
2929
test_tick &&
3030
git config i18n.commitEncoding iso8859-1 &&
31-
git commit -m "$(commit_msg iso8859-1)" &&
31+
commit_msg iso8859-1 | git commit -F - &&
3232
git add bar &&
3333
test_tick &&
3434
git commit -m "add bar" &&

t/t4210-log-i18n.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output encoding (utf8)' '
3434
test_cmp expect actual
3535
'
3636

37-
test_expect_success 'log --grep searches in log output encoding (latin1)' '
37+
test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin1)' '
3838
cat >expect <<-\EOF &&
3939
latin1
4040
utf8
@@ -43,7 +43,7 @@ test_expect_success 'log --grep searches in log output encoding (latin1)' '
4343
test_cmp expect actual
4444
'
4545

46-
test_expect_success 'log --grep does not find non-reencoded values (utf8)' '
46+
test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values (utf8)' '
4747
>expect &&
4848
git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
4949
test_cmp expect actual

t/t5504-fetch-receive-strict.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ test_expect_success 'push with receive.fsckobjects' '
101101
git config transfer.fsckobjects false
102102
) &&
103103
test_must_fail git push --porcelain dst master:refs/heads/test >act &&
104-
test_cmp exp act
104+
test_cmp exp act || test ! -s act
105105
'
106106

107107
test_expect_success 'push with transfer.fsckobjects' '
@@ -112,7 +112,7 @@ test_expect_success 'push with transfer.fsckobjects' '
112112
git config transfer.fsckobjects true
113113
) &&
114114
test_must_fail git push --porcelain dst master:refs/heads/test >act &&
115-
test_cmp exp act
115+
test_cmp exp act || test ! -s act
116116
'
117117

118118
test_done

t/t6006-rev-list-format.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ test_expect_success 'setup' '
2222
: >foo &&
2323
git add foo &&
2424
git config i18n.commitEncoding iso8859-1 &&
25-
git commit -m "$added_iso88591" &&
25+
echo "$added_iso88591" | git commit -F - &&
2626
head1=$(git rev-parse --verify HEAD) &&
2727
head1_short=$(git rev-parse --verify --short $head1) &&
2828
tree1=$(git rev-parse --verify HEAD:) &&
2929
tree1_short=$(git rev-parse --verify --short $tree1) &&
3030
echo "$changed" > foo &&
31-
git commit -a -m "$changed_iso88591" &&
31+
echo "$changed_iso88591" | git commit -a -F - &&
3232
head2=$(git rev-parse --verify HEAD) &&
3333
head2_short=$(git rev-parse --verify --short $head2) &&
3434
tree2=$(git rev-parse --verify HEAD:) &&

t/t7102-reset.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ test_expect_success 'creating initial files and commits' '
4141
4242
echo "1st line 2nd file" >secondfile &&
4343
echo "2nd line 2nd file" >>secondfile &&
44-
git -c "i18n.commitEncoding=iso8859-1" commit -a -m "$(commit_msg iso8859-1)" &&
44+
# "git commit -m" would break MinGW, as Windows refuse to pass
45+
# iso8859-1 encoded parameter to git.
46+
commit_msg iso8859-1 | git -c "i18n.commitEncoding=iso8859-1" commit -a -F - &&
4547
head5=$(git rev-parse --verify HEAD)
4648
'
4749
# git log --pretty=oneline # to see those SHA1 involved
@@ -331,7 +333,9 @@ test_expect_success 'redoing the last two commits should succeed' '
331333
332334
echo "1st line 2nd file" >secondfile &&
333335
echo "2nd line 2nd file" >>secondfile &&
334-
git -c "i18n.commitEncoding=iso8859-1" commit -a -m "$(commit_msg iso8859-1)" &&
336+
# "git commit -m" would break MinGW, as Windows refuse to pass
337+
# iso8859-1 encoded parameter to git.
338+
commit_msg iso8859-1 | git -c "i18n.commitEncoding=iso8859-1" commit -a -F - &&
335339
check_changes $head5
336340
'
337341

t/t8005-blame-i18n.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ author $SJIS_NAME
3333
summary $SJIS_MSG
3434
EOF
3535

36-
test_expect_success \
36+
test_expect_success NOT_MINGW \
3737
'blame respects i18n.commitencoding' '
3838
git blame --incremental file | \
3939
egrep "^(author|summary) " > actual &&
@@ -49,7 +49,7 @@ author $EUC_JAPAN_NAME
4949
summary $EUC_JAPAN_MSG
5050
EOF
5151

52-
test_expect_success \
52+
test_expect_success NOT_MINGW \
5353
'blame respects i18n.logoutputencoding' '
5454
git config i18n.logoutputencoding eucJP &&
5555
git blame --incremental file | \
@@ -66,7 +66,7 @@ author $UTF8_NAME
6666
summary $UTF8_MSG
6767
EOF
6868

69-
test_expect_success \
69+
test_expect_success NOT_MINGW \
7070
'blame respects --encoding=UTF-8' '
7171
git blame --incremental --encoding=UTF-8 file | \
7272
egrep "^(author|summary) " > actual &&
@@ -82,7 +82,7 @@ author $UTF8_NAME
8282
summary $UTF8_MSG
8383
EOF
8484

85-
test_expect_success \
85+
test_expect_success NOT_MINGW \
8686
'blame respects --encoding=none' '
8787
git blame --incremental --encoding=none file | \
8888
egrep "^(author|summary) " > actual &&

t/t9350-fast-export.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,4 +504,15 @@ test_expect_success 'refs are updated even if no commits need to be exported' '
504504
test_cmp expected actual
505505
'
506506

507+
cat > expected << EOF
508+
reset refs/heads/master
509+
from $(git rev-parse master)
510+
511+
EOF
512+
513+
test_expect_failure 'refs are updated even if no commits need to be exported' '
514+
git fast-export master..master > actual &&
515+
test_cmp expected actual
516+
'
517+
507518
test_done

0 commit comments

Comments
 (0)