aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/lib-httpd/apache.conf10
-rw-r--r--t/t0021/rot13-filter.pl17
-rwxr-xr-xt/t0302-credential-store.sh2
-rwxr-xr-xt/t3030-merge-recursive.sh50
-rwxr-xr-xt/t3418-rebase-continue.sh14
-rwxr-xr-xt/t3900-i18n-commit.sh8
-rwxr-xr-xt/t7500-commit.sh4
-rwxr-xr-xt/t9020-remote-svn.sh4
-rwxr-xr-xt/t9107-git-svn-migrate.sh2
9 files changed, 94 insertions, 17 deletions
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index df1943631..724d9ae46 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -25,6 +25,9 @@ ErrorLog error.log
<IfModule !mod_headers.c>
LoadModule headers_module modules/mod_headers.so
</IfModule>
+<IfModule !mod_setenvif.c>
+ LoadModule setenvif_module modules/mod_setenvif.so
+</IfModule>
<IfVersion < 2.4>
LockFile accept.lock
@@ -67,9 +70,6 @@ LockFile accept.lock
<IfModule !mod_unixd.c>
LoadModule unixd_module modules/mod_unixd.so
</IfModule>
-<IfModule !mod_setenvif.c>
- LoadModule setenvif_module modules/mod_setenvif.so
-</IfModule>
</IfVersion>
PassEnv GIT_VALGRIND
@@ -79,9 +79,7 @@ PassEnv ASAN_OPTIONS
PassEnv GIT_TRACE
PassEnv GIT_CONFIG_NOSYSTEM
-<IfVersion >= 2.4>
- SetEnvIf Git-Protocol ".*" GIT_PROTOCOL=$0
-</IfVersion>
+SetEnvIf Git-Protocol ".*" GIT_PROTOCOL=$0
Alias /dumb/ www/
Alias /auth/dumb/ www/auth/dumb/
diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
index f1678851d..470107248 100644
--- a/t/t0021/rot13-filter.pl
+++ b/t/t0021/rot13-filter.pl
@@ -31,7 +31,22 @@
#
use 5.008;
-use lib (split(/:/, $ENV{GITPERLLIB}));
+sub gitperllib {
+ # Git assumes that all path lists are Unix-y colon-separated ones. But
+ # when the Git for Windows executes the test suite, its MSYS2 Bash
+ # calls git.exe, and colon-separated path lists are converted into
+ # Windows-y semicolon-separated lists of *Windows* paths (which
+ # naturally contain a colon after the drive letter, so splitting by
+ # colons simply does not cut it).
+ #
+ # Detect semicolon-separated path list and handle them appropriately.
+
+ if ($ENV{GITPERLLIB} =~ /;/) {
+ return split(/;/, $ENV{GITPERLLIB});
+ }
+ return split(/:/, $ENV{GITPERLLIB});
+}
+use lib (gitperllib());
use strict;
use warnings;
use IO::File;
diff --git a/t/t0302-credential-store.sh b/t/t0302-credential-store.sh
index 1d8d1f210..d6b54e8c6 100755
--- a/t/t0302-credential-store.sh
+++ b/t/t0302-credential-store.sh
@@ -37,7 +37,7 @@ helper_test store
unset XDG_CONFIG_HOME
test_expect_success 'if custom xdg file exists, home and xdg files not created' '
- test_when_finished "rm -f $HOME/xdg/git/credentials" &&
+ test_when_finished "rm -f \"$HOME/xdg/git/credentials\"" &&
test -s "$HOME/xdg/git/credentials" &&
test_path_is_missing "$HOME/.git-credentials" &&
test_path_is_missing "$HOME/.config/git/credentials"
diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index 9a893b5fe..cdc38fe5d 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -678,4 +678,54 @@ test_expect_success 'merge-recursive remembers the names of all base trees' '
test_cmp expect actual
'
+test_expect_success 'merge-recursive internal merge resolves to the sameness' '
+ git reset --hard HEAD &&
+
+ # We are going to create a history leading to two criss-cross
+ # branches A and B. The common ancestor at the bottom, O0,
+ # has two child commits O1 and O2, both of which will be merge
+ # base between A and B, like so:
+ #
+ # O1---A
+ # / \ /
+ # O0 .
+ # \ / \
+ # O2---B
+ #
+ # The recently added "check to see if the index is different from
+ # the tree into which something else is getting merged" check must
+ # NOT kick in when an inner merge between O1 and O2 is made. Both
+ # O1 and O2 happen to have the same tree as O0 in this test to
+ # trigger the bug---whether the inner merge is made by merging O2
+ # into O1 or O1 into O2, their common ancestor O0 and the branch
+ # being merged have the same tree. We should not trigger the "is
+ # the index dirty?" check in this case.
+
+ echo "zero" >file &&
+ git add file &&
+ test_tick &&
+ git commit -m "O0" &&
+ O0=$(git rev-parse HEAD) &&
+
+ test_tick &&
+ git commit --allow-empty -m "O1" &&
+ O1=$(git rev-parse HEAD) &&
+
+ git reset --hard $O0 &&
+ test_tick &&
+ git commit --allow-empty -m "O2" &&
+ O2=$(git rev-parse HEAD) &&
+
+ test_tick &&
+ git merge -s ours $O1 &&
+ B=$(git rev-parse HEAD) &&
+
+ git reset --hard $O1 &&
+ test_tick &&
+ git merge -s ours $O2 &&
+ A=$(git rev-parse HEAD) &&
+
+ git merge $B
+'
+
test_done
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index fcfdd197b..7c91a85f4 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -74,6 +74,20 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
test -f funny.was.run
'
+test_expect_success 'rebase passes merge strategy options correctly' '
+ rm -fr .git/rebase-* &&
+ git reset --hard commit-new-file-F3-on-topic-branch &&
+ test_commit theirs-to-merge &&
+ git reset --hard HEAD^ &&
+ test_commit some-commit &&
+ test_tick &&
+ git merge --no-ff theirs-to-merge &&
+ FAKE_LINES="1 edit 2 3" git rebase -i -f -p -m \
+ -s recursive --strategy-option=theirs HEAD~2 &&
+ test_commit force-change &&
+ git rebase --continue
+'
+
test_expect_success 'setup rerere database' '
rm -fr .git/rebase-* &&
git reset --hard commit-new-file-F3-on-topic-branch &&
diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh
index 3b94283e3..b92ff9597 100755
--- a/t/t3900-i18n-commit.sh
+++ b/t/t3900-i18n-commit.sh
@@ -40,7 +40,7 @@ test_expect_success 'UTF-16 refused because of NULs' '
'
test_expect_success 'UTF-8 invalid characters refused' '
- test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
+ test_when_finished "rm -f \"\$HOME/stderr\" \"\$HOME/invalid\"" &&
echo "UTF-8 characters" >F &&
printf "Commit message\n\nInvalid surrogate:\355\240\200\n" \
>"$HOME/invalid" &&
@@ -49,7 +49,7 @@ test_expect_success 'UTF-8 invalid characters refused' '
'
test_expect_success 'UTF-8 overlong sequences rejected' '
- test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
+ test_when_finished "rm -f \"\$HOME/stderr\" \"\$HOME/invalid\"" &&
rm -f "$HOME/stderr" "$HOME/invalid" &&
echo "UTF-8 overlong" >F &&
printf "\340\202\251ommit message\n\nThis is not a space:\300\240\n" \
@@ -59,7 +59,7 @@ test_expect_success 'UTF-8 overlong sequences rejected' '
'
test_expect_success 'UTF-8 non-characters refused' '
- test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
+ test_when_finished "rm -f \"\$HOME/stderr\" \"\$HOME/invalid\"" &&
echo "UTF-8 non-character 1" >F &&
printf "Commit message\n\nNon-character:\364\217\277\276\n" \
>"$HOME/invalid" &&
@@ -68,7 +68,7 @@ test_expect_success 'UTF-8 non-characters refused' '
'
test_expect_success 'UTF-8 non-characters refused' '
- test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
+ test_when_finished "rm -f \"\$HOME/stderr\" \"\$HOME/invalid\"" &&
echo "UTF-8 non-character 2." >F &&
printf "Commit message\n\nNon-character:\357\267\220\n" \
>"$HOME/invalid" &&
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index 5739d3ed2..1d33c5feb 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -130,8 +130,8 @@ EOF
test_expect_success 'commit message from template with whitespace issue' '
echo "content galore" >>foo &&
git add foo &&
- GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-whitespaced-content git commit \
- --template "$TEMPLATE" &&
+ GIT_EDITOR=\""$TEST_DIRECTORY"\"/t7500/add-whitespaced-content \
+ git commit --template "$TEMPLATE" &&
commit_msg_is "commit message"
'
diff --git a/t/t9020-remote-svn.sh b/t/t9020-remote-svn.sh
index 4d81ba1c2..6fca08e5e 100755
--- a/t/t9020-remote-svn.sh
+++ b/t/t9020-remote-svn.sh
@@ -25,8 +25,8 @@ init_git () {
git init &&
#git remote add svnsim testsvn::sim:///$TEST_DIRECTORY/t9020/example.svnrdump
# let's reuse an existing dump file!?
- git remote add svnsim testsvn::sim://$TEST_DIRECTORY/t9154/svn.dump
- git remote add svnfile testsvn::file://$TEST_DIRECTORY/t9154/svn.dump
+ git remote add svnsim "testsvn::sim://$TEST_DIRECTORY/t9154/svn.dump"
+ git remote add svnfile "testsvn::file://$TEST_DIRECTORY/t9154/svn.dump"
}
if test -e "$GIT_BUILD_DIR/git-remote-testsvn"
diff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh
index 9f3ef8f2e..ceaa5bad1 100755
--- a/t/t9107-git-svn-migrate.sh
+++ b/t/t9107-git-svn-migrate.sh
@@ -28,7 +28,7 @@ test_expect_success 'git-svn-HEAD is a real HEAD' '
git rev-parse --verify refs/heads/git-svn-HEAD^0
'
-svnrepo_escaped=$(echo $svnrepo | sed 's/ /%20/')
+svnrepo_escaped=$(echo $svnrepo | sed 's/ /%20/g')
test_expect_success 'initialize old-style (v0) git svn layout' '
mkdir -p "$GIT_DIR"/git-svn/info "$GIT_DIR"/svn/info &&