Merge tag 'l10n-2.16.0-rnd2' of git://github.com/git-l10n/git-po

l10n for Git 2.16.0 round 2

* tag 'l10n-2.16.0-rnd2' of git://github.com/git-l10n/git-po: (24 commits)
  l10n: de.po: translate 72 new messages
  l10n: de.po: improve messages when a branch starts to track another ref
  l10n: bg.po: Updated Bulgarian translation (3288t)
  l10n: TEAMS: add zh_CN team members
  l10n: zh_CN: for git v2.16.0 l10n round 2
  l10n: sv.po: Update Swedish translation (3288t0f0u)
  l10n: ru.po: update Russian translation
  l10n: TEAMS: Add ko team members
  l10n: ko.po: Update Korean translation
  l10n: fr.po 2.16 round 2
  l10n: es.po: Spanish translation 2.16.0 round 2
  l10n: vi.po(3288t): Updated Vietnamese translation for v2.16.0 round 2
  l10n: git.pot: v2.16.0 round 2 (8 new, 4 removed)
  l10n: es.po: Update Spanish Translation v2.16.0
  l10n: fr.po v2.16.0 round 1
  l10n: bg.po: Updated Bulgarian translation (3284t)
  l10n: sv.po: Update Swedish translation (3284t0f0u)
  l10n: fr.po: "worktree list" mistranslated as prune
  l10n: git.pot: v2.16.0 round 1 (64 new, 25 removed)
  l10n: fixes to German translation
  ...
diff --git a/.travis.yml b/.travis.yml
index 7c9aa05..4684b3f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -42,6 +42,7 @@
     - env: jobname=Linux32
       os: linux
       compiler:
+      addons:
       services:
         - docker
       before_install:
diff --git a/Documentation/RelNotes/2.16.0.txt b/Documentation/RelNotes/2.16.0.txt
index c648c12..919f3eb 100644
--- a/Documentation/RelNotes/2.16.0.txt
+++ b/Documentation/RelNotes/2.16.0.txt
@@ -341,7 +341,7 @@
  * Command line completion (in contrib/) has been taught about the
    "--copy" option of "git branch".
 
- * When "git rebase" prepared an mailbox of changes and fed it to "git
+ * When "git rebase" prepared a mailbox of changes and fed it to "git
    am" to replay them, it was confused when a stray "From " happened
    to be in the log message of one of the replayed changes.  This has
    been corrected.
@@ -441,6 +441,15 @@
    credential helper fail.
    (merge 4c267f2ae3 jd/fix-strbuf-add-urlencode-bytes later to maint).
 
+ * "git rebase -p -X<option>" did not propagate the option properly
+   down to underlying merge strategy backend.
+   (merge dd6fb0053c js/fix-merge-arg-quoting-in-rebase-p later to maint).
+
+ * "git merge -s recursive" did not correctly abort when the index is
+   dirty, if the merged tree happened to be the same as the current
+   HEAD, which has been fixed.
+   (merge f309e8e768 ew/empty-merge-with-dirty-index-maint later to maint).
+
  * Other minor doc, test and build updates and code cleanups.
    (merge 1a1fc2d5b5 rd/man-prune-progress later to maint).
    (merge 0ba014035a rd/man-reflog-add-n later to maint).
@@ -467,3 +476,4 @@
    (merge 3f824e91c8 jk/test-suite-tracing later to maint).
    (merge 1feb061701 db/doc-config-section-names-with-bs later to maint).
    (merge 74dea0e13c jh/memihash-opt later to maint).
+   (merge 2e9fdc795c ma/bisect-leakfix later to maint).
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 3ef3092..a1d0fec 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -261,7 +261,7 @@
 
 Send your patch with "To:" set to the mailing list, with "cc:" listing
 people who are involved in the area you are touching (the output from
-+git blame _$path_+ and +git shortlog {litdd}no-merges _$path_+ would help to
+`git blame $path` and `git shortlog --no-merges $path` would help to
 identify them), to solicit comments and reviews.
 
 :1: footnote:[The current maintainer: gitster@pobox.com]
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 9d1586b..743af97 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -469,6 +469,12 @@
 +
 Also, these upper-case letters can be downcased to exclude.  E.g.
 `--diff-filter=ad` excludes added and deleted paths.
++
+Note that not all diffs can feature all types. For instance, diffs
+from the index to the working tree can never have Added entries
+(because the set of paths included in the diff is limited by what is in
+the index).  Similarly, copied and renamed entries cannot appear if
+detection for those types is disabled.
 
 -S<string>::
 	Look for differences that change the number of occurrences of
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index f850e8f..41585f5 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -118,7 +118,7 @@
 --[no-]guess-remote::
 	With `worktree add <path>`, without `<commit-ish>`, instead
 	of creating a new branch from HEAD, if there exists a tracking
-	branch in exactly one remote matching the basename of `<path>,
+	branch in exactly one remote matching the basename of `<path>`,
 	base the new branch on the remote-tracking branch, and mark
 	the remote-tracking branch as "upstream" from the new branch.
 +
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index e55ac4c..258aff3 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v2.16.0-rc1
+DEF_VER=v2.16.0-rc2
 
 LF='
 '
diff --git a/Makefile b/Makefile
index bb5b7cd..1a9b23b 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,6 @@
 # it at all).
 #
 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
-# This also implies BLK_SHA1.
 #
 # Define USE_LIBPCRE if you have and want to use libpcre. Various
 # commands such as log and grep offer runtime options to use
@@ -1275,7 +1274,6 @@
 	endif
 else
 	BASIC_CFLAGS += -DNO_OPENSSL
-	BLK_SHA1 = 1
 	OPENSSL_LIBSSL =
 endif
 ifdef NO_OPENSSL
diff --git a/bisect.c b/bisect.c
index 0fca17c..2f3008b 100644
--- a/bisect.c
+++ b/bisect.c
@@ -229,8 +229,10 @@
 		if (i < cnt - 1)
 			p = p->next;
 	}
-	free_commit_list(p->next);
-	p->next = NULL;
+	if (p) {
+		free_commit_list(p->next);
+		p->next = NULL;
+	}
 	strbuf_release(&buf);
 	free(array);
 	return list;
diff --git a/ci/lib-travisci.sh b/ci/lib-travisci.sh
index 331d3eb..07f27c7 100755
--- a/ci/lib-travisci.sh
+++ b/ci/lib-travisci.sh
@@ -16,16 +16,77 @@
 	if TAG=$(git describe --exact-match "$TRAVIS_BRANCH" 2>/dev/null) &&
 		test "$TAG" != "$TRAVIS_BRANCH"
 	then
-		echo "Tip of $TRAVIS_BRANCH is exactly at $TAG"
+		echo "$(tput setaf 2)Tip of $TRAVIS_BRANCH is exactly at $TAG$(tput sgr0)"
 		exit 0
 	fi
 }
 
+good_trees_file="$HOME/travis-cache/good-trees"
+
+# Save some info about the current commit's tree, so we can skip the build
+# job if we encounter the same tree again and can provide a useful info
+# message.
+save_good_tree () {
+	echo "$(git rev-parse $TRAVIS_COMMIT^{tree}) $TRAVIS_COMMIT $TRAVIS_JOB_NUMBER $TRAVIS_JOB_ID" >>"$good_trees_file"
+	# limit the file size
+	tail -1000 "$good_trees_file" >"$good_trees_file".tmp
+	mv "$good_trees_file".tmp "$good_trees_file"
+}
+
+# Skip the build job if the same tree has already been built and tested
+# successfully before (e.g. because the branch got rebased, changing only
+# the commit messages).
+skip_good_tree () {
+	if ! good_tree_info="$(grep "^$(git rev-parse $TRAVIS_COMMIT^{tree}) " "$good_trees_file")"
+	then
+		# Haven't seen this tree yet, or no cached good trees file yet.
+		# Continue the build job.
+		return
+	fi
+
+	echo "$good_tree_info" | {
+		read tree prev_good_commit prev_good_job_number prev_good_job_id
+
+		if test "$TRAVIS_JOB_ID" = "$prev_good_job_id"
+		then
+			cat <<-EOF
+			$(tput setaf 2)Skipping build job for commit $TRAVIS_COMMIT.$(tput sgr0)
+			This commit has already been built and tested successfully by this build job.
+			To force a re-build delete the branch's cache and then hit 'Restart job'.
+			EOF
+		else
+			cat <<-EOF
+			$(tput setaf 2)Skipping build job for commit $TRAVIS_COMMIT.$(tput sgr0)
+			This commit's tree has already been built and tested successfully in build job $prev_good_job_number for commit $prev_good_commit.
+			The log of that build job is available at https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$prev_good_job_id
+			To force a re-build delete the branch's cache and then hit 'Restart job'.
+			EOF
+		fi
+	}
+
+	exit 0
+}
+
+check_unignored_build_artifacts ()
+{
+	! git ls-files --other --exclude-standard --error-unmatch \
+		-- ':/*' 2>/dev/null ||
+	{
+		echo "$(tput setaf 1)error: found unignored build artifacts$(tput sgr0)"
+		false
+	}
+}
+
 # Set 'exit on error' for all CI scripts to let the caller know that
-# something went wrong
+# something went wrong.
+# Set tracing executed commands, primarily setting environment variables
+# and installing dependencies.
 set -ex
 
+mkdir -p "$HOME/travis-cache"
+
 skip_branch_tip_with_tag
+skip_good_tree
 
 if test -z "$jobname"
 then
@@ -48,8 +109,8 @@
 	export LINUX_P4_VERSION="16.2"
 	export LINUX_GIT_LFS_VERSION="1.5.2"
 
-	P4_PATH="$(pwd)/custom/p4"
-	GIT_LFS_PATH="$(pwd)/custom/git-lfs"
+	P4_PATH="$HOME/custom/p4"
+	GIT_LFS_PATH="$HOME/custom/git-lfs"
 	export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH"
 	;;
 osx-clang|osx-gcc)
diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh
index 8c8973c..4f261dd 100755
--- a/ci/print-test-failures.sh
+++ b/ci/print-test-failures.sh
@@ -5,6 +5,15 @@
 
 . ${0%/*}/lib-travisci.sh
 
+# Tracing executed commands would produce too much noise in the loop below.
+set +x
+
+if ! ls t/test-results/*.exit >/dev/null 2>/dev/null
+then
+	echo "Build job failed before the tests could have been run"
+	exit
+fi
+
 for TEST_EXIT in t/test-results/*.exit
 do
 	if [ "$(cat "$TEST_EXIT")" != "0" ]
diff --git a/ci/run-linux32-build.sh b/ci/run-linux32-build.sh
index e30fb2c..c19c50c 100755
--- a/ci/run-linux32-build.sh
+++ b/ci/run-linux32-build.sh
@@ -6,6 +6,8 @@
 #   run-linux32-build.sh [host-user-id]
 #
 
+set -x
+
 # Update packages to the latest available versions
 linux32 --32bit i386 sh -c '
     apt update >/dev/null &&
@@ -25,6 +27,7 @@
 # Build and test
 linux32 --32bit i386 su -m -l $CI_USER -c '
     cd /usr/src/git &&
+    ln -s /tmp/travis-cache/.prove t/.prove &&
     make --jobs=2 &&
     make --quiet test
 '
diff --git a/ci/run-linux32-docker.sh b/ci/run-linux32-docker.sh
index 0edf63a..4f191c5 100755
--- a/ci/run-linux32-docker.sh
+++ b/ci/run-linux32-docker.sh
@@ -19,5 +19,10 @@
 	--env GIT_TEST_OPTS \
 	--env GIT_TEST_CLONE_2GB \
 	--volume "${PWD}:/usr/src/git" \
+	--volume "${HOME}/travis-cache:/tmp/travis-cache" \
 	daald/ubuntu32:xenial \
 	/usr/src/git/ci/run-linux32-build.sh $(id -u $USER)
+
+check_unignored_build_artifacts
+
+save_good_tree
diff --git a/ci/run-static-analysis.sh b/ci/run-static-analysis.sh
index 68dd0f0..fe4ee4e 100755
--- a/ci/run-static-analysis.sh
+++ b/ci/run-static-analysis.sh
@@ -6,3 +6,5 @@
 . ${0%/*}/lib-travisci.sh
 
 make coccicheck
+
+save_good_tree
diff --git a/ci/run-tests.sh b/ci/run-tests.sh
index f0c743d..22355f0 100755
--- a/ci/run-tests.sh
+++ b/ci/run-tests.sh
@@ -5,6 +5,9 @@
 
 . ${0%/*}/lib-travisci.sh
 
-mkdir -p $HOME/travis-cache
 ln -s $HOME/travis-cache/.prove t/.prove
 make --quiet test
+
+check_unignored_build_artifacts
+
+save_good_tree
diff --git a/ci/run-windows-build.sh b/ci/run-windows-build.sh
index 8757b3a..d99a180 100755
--- a/ci/run-windows-build.sh
+++ b/ci/run-windows-build.sh
@@ -69,6 +69,10 @@
 
 echo "Visual Studio Team Services Build #${BUILD_ID}"
 
+# Tracing execued commands would produce too much noise in the waiting
+# loop below.
+set +x
+
 # Wait until build job finished
 STATUS=
 RESULT=
@@ -90,7 +94,10 @@
 # Print log
 echo ""
 echo ""
+set -x
 gfwci "action=log&buildId=$BUILD_ID" | cut -c 30-
 
 # Set exit code for TravisCI
 test "$RESULT" = "success"
+
+save_good_tree
diff --git a/ci/test-documentation.sh b/ci/test-documentation.sh
index 7a0a848..a20de9c 100755
--- a/ci/test-documentation.sh
+++ b/ci/test-documentation.sh
@@ -18,6 +18,9 @@
 test -s Documentation/git.1
 grep '<meta name="generator" content="AsciiDoc ' Documentation/git.html
 
+rm -f stdout.log stderr.log
+check_unignored_build_artifacts
+
 # Build docs with AsciiDoctor
 make clean
 make --jobs=2 USE_ASCIIDOCTOR=1 doc > >(tee stdout.log) 2> >(tee stderr.log >&2)
@@ -25,3 +28,8 @@
 ! test -s stderr.log
 test -s Documentation/git.html
 grep '<meta name="generator" content="Asciidoctor ' Documentation/git.html
+
+rm -f stdout.log stderr.log
+check_unignored_build_artifacts
+
+save_good_tree
diff --git a/configure.ac b/configure.ac
index 2f55237..7f84151 100644
--- a/configure.ac
+++ b/configure.ac
@@ -241,7 +241,6 @@
 # a bundled SHA1 routine optimized for PowerPC.
 #
 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
-# This also implies BLK_SHA1.
 #
 # Define OPENSSLDIR=/foo/bar if your openssl header and library files are in
 # /foo/bar/include and /foo/bar/lib directories.
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index ed24aa9..91c00e6 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -2501,9 +2501,28 @@
 		set pos [split [$w index @$x,$y] .]
 		foreach {lno col} $pos break
 	} else {
+		if {$mode eq "toggle"} {
+			if {$w eq $ui_workdir} {
+				do_add_selection
+				set last_clicked {}
+				return
+			}
+			if {$w eq $ui_index} {
+				do_unstage_selection
+				set last_clicked {}
+				return
+			}
+		}
+
 		if {$last_clicked ne {}} {
 			set lno [lindex $last_clicked 1]
 		} else {
+			if {![info exists file_lists]
+				|| ![info exists file_lists($w)]
+				|| [llength $file_lists($w)] == 0} {
+				set last_clicked {}
+				return
+			}
 			set lno [expr {int([lindex [$w tag ranges in_diff] 0])}]
 		}
 		if {$mode eq "toggle"} {
@@ -2514,7 +2533,13 @@
 		}
 	}
 
-	set path [lindex $file_lists($w) [expr {$lno - 1}]]
+	if {![info exists file_lists]
+		|| ![info exists file_lists($w)]
+		|| [llength $file_lists($w)] < $lno - 1} {
+		set path {}
+	} else {
+		set path [lindex $file_lists($w) [expr {$lno - 1}]]
+	}
 	if {$path eq {}} {
 		set last_clicked {}
 		return
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index 4cae10a..68c4a6c 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -698,6 +698,7 @@
 		set hh [$ui_diff get $i_l "$i_l + 1 lines"]
 		set hh [lindex [split $hh ,] 0]
 		set hln [lindex [split $hh -] 1]
+		set hln [lindex [split $hln " "] 0]
 
 		# There is a special situation to take care of. Consider this
 		# hunk:
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index b7f9567..d47bd29 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -392,9 +392,12 @@
 			new_parents=${new_parents# $first_parent}
 			merge_args="--no-log --no-ff"
 			if ! do_with_author output eval \
-			'git merge ${gpg_sign_opt:+"$gpg_sign_opt"} \
-				$allow_rerere_autoupdate $merge_args \
-				$strategy_args -m "$msg_content" $new_parents'
+				git merge ${gpg_sign_opt:+$(git rev-parse \
+					--sq-quote "$gpg_sign_opt")} \
+				$allow_rerere_autoupdate "$merge_args" \
+				"$strategy_args" \
+				-m $(git rev-parse --sq-quote "$msg_content") \
+				"$new_parents"
 			then
 				printf "%s\n" "$msg_content" > "$GIT_DIR"/MERGE_MSG
 				die_with_patch $sha1 "$(eval_gettext "Error redoing merge \$sha1")"
diff --git a/merge-recursive.c b/merge-recursive.c
index 780f81a..0fc580d 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1954,7 +1954,7 @@
 	if (oid_eq(&common->object.oid, &merge->object.oid)) {
 		struct strbuf sb = STRBUF_INIT;
 
-		if (index_has_changes(&sb)) {
+		if (!o->call_depth && index_has_changes(&sb)) {
 			err(o, _("Dirty index: cannot merge (dirty: %s)"),
 			    sb.buf);
 			return 0;
diff --git a/oidset.h b/oidset.h
index 783abce..40ec5f8 100644
--- a/oidset.h
+++ b/oidset.h
@@ -27,7 +27,7 @@
 
 static inline void oidset_init(struct oidset *set, size_t initial_size)
 {
-	return oidmap_init(&set->map, initial_size);
+	oidmap_init(&set->map, initial_size);
 }
 
 /**
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index df19436..724d9ae 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -25,6 +25,9 @@
 <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 @@
 <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 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 f167885..4701072 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 1d8d1f2..d6b54e8 100755
--- a/t/t0302-credential-store.sh
+++ b/t/t0302-credential-store.sh
@@ -37,7 +37,7 @@
 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 9a893b5..cdc38fe 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -678,4 +678,54 @@
 	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 fcfdd19..7c91a85 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -74,6 +74,20 @@
 	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 3b94283..b92ff95 100755
--- a/t/t3900-i18n-commit.sh
+++ b/t/t3900-i18n-commit.sh
@@ -40,7 +40,7 @@
 '
 
 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 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 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_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 5739d3e..1d33c5f 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -130,8 +130,8 @@
 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 4d81ba1..6fca08e 100755
--- a/t/t9020-remote-svn.sh
+++ b/t/t9020-remote-svn.sh
@@ -25,8 +25,8 @@
 	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 9f3ef8f..ceaa5ba 100755
--- a/t/t9107-git-svn-migrate.sh
+++ b/t/t9107-git-svn-migrate.sh
@@ -28,7 +28,7 @@
 	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 &&