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

Commit

Permalink
Merge 'win-tests-rebase'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dscho committed Apr 11, 2014
2 parents 9d3f42a + 3ed8dae commit d0859cc
Showing 19 changed files with 94 additions and 51 deletions.
24 changes: 12 additions & 12 deletions t/annotate-tests.sh
Original file line number Diff line number Diff line change
@@ -251,27 +251,27 @@ test_expect_success 'blame -L X,-N' '
'

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

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

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

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

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

test_expect_success 'blame -L /RE/,-N' '
check_count -L/99/,-3 B 1 B2 1 D 1
check_count -L/\;*99/,-3 B 1 B2 1 D 1
'

# '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)' '
'

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

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

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

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

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

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

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

test_expect_success 'blame -L ^/RE/ (absolute: not found)' '
8 changes: 7 additions & 1 deletion t/t0008-ignores.sh
Original file line number Diff line number Diff line change
@@ -5,7 +5,13 @@ test_description=check-ignore
. ./test-lib.sh

init_vars () {
global_excludes="$(pwd)/global-excludes"
# On Windows, avoid using "C:" in the global-excludes paths.
if test_have_prereq MINGW
then
global_excludes="global-excludes"
else
global_excludes="$(pwd)/global-excludes"
fi
}

enable_global_excludes () {
2 changes: 1 addition & 1 deletion t/t0081-line-buffer.sh
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' '
test_cmp expect actual
'

test_expect_success 'read from file descriptor' '
test_expect_success NOT_MINGW 'read from file descriptor' '
rm -f input &&
echo hello >expect &&
echo hello >input &&
2 changes: 1 addition & 1 deletion t/t0110-urlmatch-normalization.sh
Original file line number Diff line number Diff line change
@@ -117,7 +117,7 @@ test_expect_success 'url general escapes' '
test "$(test-urlmatch-normalization -p "X://W?'\!'")" = "x://w/?'\!'"
'

test_expect_success 'url high-bit escapes' '
test_expect_success !MINGW 'url high-bit escapes' '
test "$(test-urlmatch-normalization -p "$(cat "$tu-1")")" = "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12" &&
test "$(test-urlmatch-normalization -p "$(cat "$tu-2")")" = "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F" &&
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" &&
8 changes: 4 additions & 4 deletions t/t1050-large.sh
Original file line number Diff line number Diff line change
@@ -9,10 +9,10 @@ test_expect_success setup '
# clone does not allow us to pass core.bigfilethreshold to
# new repos, so set core.bigfilethreshold globally
git config --global core.bigfilethreshold 200k &&
echo X | dd of=large1 bs=1k seek=2000 &&
echo X | dd of=large2 bs=1k seek=2000 &&
echo X | dd of=large3 bs=1k seek=2000 &&
echo Y | dd of=huge bs=1k seek=2500 &&
perl -e "print \"\\0\" x 2048000; print \"X\\n\";" > large1 &&
perl -e "print \"\\0\" x 2048000; print \"X\\n\";" > large2 &&
perl -e "print \"\\0\" x 2048000; print \"X\\n\";" > large3 &&
perl -e "print \"\\0\" x 2560000; print \"Y\\n\";" > huge &&
GIT_ALLOC_LIMIT=1500 &&
export GIT_ALLOC_LIMIT
'
4 changes: 4 additions & 0 deletions t/t1501-worktree.sh
Original file line number Diff line number Diff line change
@@ -339,6 +339,10 @@ test_expect_success 'make_relative_path handles double slashes in GIT_DIR' '
git --git-dir="$(pwd)//repo.git" --work-tree="$(pwd)" add dummy_file
'

test_have_prereq MINGW &&
# make sure to test DOS path on Windows
TRASH_DIRECTORY="$(cd "$TRASH_DIRECTORY" && pwd)"

test_expect_success 'relative $GIT_WORK_TREE and git subprocesses' '
GIT_DIR=repo.git GIT_WORK_TREE=repo.git/work \
test-subprocess --setup-work-tree rev-parse --show-toplevel >actual &&
4 changes: 2 additions & 2 deletions t/t3102-ls-tree-wildcards.sh
Original file line number Diff line number Diff line change
@@ -4,14 +4,14 @@ test_description='ls-tree with(out) globs'

. ./test-lib.sh

test_expect_success 'setup' '
test_expect_success NOT_MINGW 'setup' '
mkdir a aa "a[a]" &&
touch a/one aa/two "a[a]/three" &&
git add a/one aa/two "a[a]/three" &&
git commit -m test
'

test_expect_success 'ls-tree a[a] matches literally' '
test_expect_success NOT_MINGW 'ls-tree a* matches literally' '
cat >expected <<EOF &&
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a[a]/three
EOF
19 changes: 11 additions & 8 deletions t/t3901-i18n-patch.sh
Original file line number Diff line number Diff line change
@@ -54,10 +54,13 @@ test_expect_success setup '
git add yours &&
git commit -s -m "Second on side" &&
# the second one on the side branch is ISO-8859-1
git config i18n.commitencoding ISO8859-1 &&
# use author and committer name in ISO-8859-1 to match it.
. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
if test_have_prereq NOT_MINGW
then
# the second one on the side branch is ISO-8859-1
git config i18n.commitencoding ISO8859-1 &&
# use author and committer name in ISO-8859-1 to match it.
. "$TEST_DIRECTORY"/t3901-8859-1.txt
fi &&
test_tick &&
echo Yet another >theirs &&
git add theirs &&
@@ -119,7 +122,7 @@ test_expect_success 'rebase (U/L)' '
check_encoding 2
'

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

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

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

test_expect_success 'cherry-pick(L/U)' '
test_expect_success NOT_MINGW 'cherry-pick(L/U)' '
# Again, the commitencoding is set to ISO-8859-1 but
# logoutputencoding is set to UTF-8.
6 changes: 4 additions & 2 deletions t/t4041-diff-submodule-option.sh
Original file line number Diff line number Diff line change
@@ -23,8 +23,10 @@ add_file () {
echo "$name" >"$name" &&
git add "$name" &&
test_tick &&
msg_added_iso88591=$(echo "Add $name ($added $name)" | iconv -f utf-8 -t iso8859-1) &&
git -c 'i18n.commitEncoding=iso8859-1' commit -m "$msg_added_iso88591"
# "git commit -m" would break MinGW, as Windows refuse to pass
# iso8859-1 encoded parameter to git.
echo "Add $name ($added $name)" | iconv -f utf-8 -t iso8859-1 |
git -c 'i18n.commitEncoding=iso8859-1' commit -F -
done >/dev/null &&
git rev-parse --short --verify HEAD
)
6 changes: 3 additions & 3 deletions t/t4201-shortlog.sh
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '
test_cmp expect log.predictable
'

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

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

test_expect_success 'shortlog encoding' '
test_expect_success NOT_MINGW 'shortlog encoding' '
git reset --hard "$commit" &&
git config --unset i18n.commitencoding &&
echo 2 > a1 &&
2 changes: 1 addition & 1 deletion t/t4205-log-pretty-formats.sh
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ test_expect_success 'set up basic repos' '
git add foo &&
test_tick &&
git config i18n.commitEncoding iso8859-1 &&
git commit -m "$(commit_msg iso8859-1)" &&
commit_msg iso8859-1 | git commit -F - &&
git add bar &&
test_tick &&
git commit -m "add bar" &&
4 changes: 2 additions & 2 deletions t/t4210-log-i18n.sh
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output encoding (utf8)' '
test_cmp expect actual
'

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

test_expect_success 'log --grep does not find non-reencoded values (utf8)' '
test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values (utf8)' '
>expect &&
git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
test_cmp expect actual
4 changes: 2 additions & 2 deletions t/t5504-fetch-receive-strict.sh
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ test_expect_success 'push with receive.fsckobjects' '
git config transfer.fsckobjects false
) &&
test_must_fail git push --porcelain dst master:refs/heads/test >act &&
test_cmp exp act
test_cmp exp act || test ! -s act
'

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

test_done
4 changes: 2 additions & 2 deletions t/t6006-rev-list-format.sh
Original file line number Diff line number Diff line change
@@ -22,13 +22,13 @@ test_expect_success 'setup' '
: >foo &&
git add foo &&
git config i18n.commitEncoding iso8859-1 &&
git commit -m "$added_iso88591" &&
echo "$added_iso88591" | git commit -F - &&
head1=$(git rev-parse --verify HEAD) &&
head1_short=$(git rev-parse --verify --short $head1) &&
tree1=$(git rev-parse --verify HEAD:) &&
tree1_short=$(git rev-parse --verify --short $tree1) &&
echo "$changed" > foo &&
git commit -a -m "$changed_iso88591" &&
echo "$changed_iso88591" | git commit -a -F - &&
head2=$(git rev-parse --verify HEAD) &&
head2_short=$(git rev-parse --verify --short $head2) &&
tree2=$(git rev-parse --verify HEAD:) &&
8 changes: 6 additions & 2 deletions t/t7102-reset.sh
Original file line number Diff line number Diff line change
@@ -41,7 +41,9 @@ test_expect_success 'creating initial files and commits' '
echo "1st line 2nd file" >secondfile &&
echo "2nd line 2nd file" >>secondfile &&
git -c "i18n.commitEncoding=iso8859-1" commit -a -m "$(commit_msg iso8859-1)" &&
# "git commit -m" would break MinGW, as Windows refuse to pass
# iso8859-1 encoded parameter to git.
commit_msg iso8859-1 | git -c "i18n.commitEncoding=iso8859-1" commit -a -F - &&
head5=$(git rev-parse --verify HEAD)
'
# git log --pretty=oneline # to see those SHA1 involved
@@ -331,7 +333,9 @@ test_expect_success 'redoing the last two commits should succeed' '
echo "1st line 2nd file" >secondfile &&
echo "2nd line 2nd file" >>secondfile &&
git -c "i18n.commitEncoding=iso8859-1" commit -a -m "$(commit_msg iso8859-1)" &&
# "git commit -m" would break MinGW, as Windows refuse to pass
# iso8859-1 encoded parameter to git.
commit_msg iso8859-1 | git -c "i18n.commitEncoding=iso8859-1" commit -a -F - &&
check_changes $head5
'

8 changes: 4 additions & 4 deletions t/t8005-blame-i18n.sh
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ author $SJIS_NAME
summary $SJIS_MSG
EOF

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

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

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

test_expect_success \
test_expect_success NOT_MINGW \
'blame respects --encoding=none' '
git blame --incremental --encoding=none file | \
egrep "^(author|summary) " > actual &&
11 changes: 11 additions & 0 deletions t/t9350-fast-export.sh
Original file line number Diff line number Diff line change
@@ -504,4 +504,15 @@ test_expect_success 'refs are updated even if no commits need to be exported' '
test_cmp expected actual
'

cat > expected << EOF
reset refs/heads/master
from $(git rev-parse master)
EOF

test_expect_failure 'refs are updated even if no commits need to be exported' '
git fast-export master..master > actual &&
test_cmp expected actual
'

test_done
Loading

0 comments on commit d0859cc

Please sign in to comment.