aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rw-r--r--Documentation/RelNotes/2.16.0.txt12
-rw-r--r--Documentation/SubmittingPatches2
-rw-r--r--Documentation/diff-options.txt6
-rw-r--r--Documentation/git-worktree.txt2
-rwxr-xr-xGIT-VERSION-GEN2
-rw-r--r--Makefile2
-rw-r--r--bisect.c6
-rwxr-xr-xci/lib-travisci.sh69
-rwxr-xr-xci/print-test-failures.sh9
-rwxr-xr-xci/run-linux32-build.sh3
-rwxr-xr-xci/run-linux32-docker.sh5
-rwxr-xr-xci/run-static-analysis.sh2
-rwxr-xr-xci/run-tests.sh5
-rwxr-xr-xci/run-windows-build.sh7
-rwxr-xr-xci/test-documentation.sh8
-rw-r--r--configure.ac1
-rwxr-xr-xgit-gui/git-gui.sh27
-rw-r--r--git-gui/lib/diff.tcl1
-rw-r--r--git-rebase--interactive.sh9
-rw-r--r--merge-recursive.c2
-rw-r--r--oidset.h2
-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
31 files changed, 257 insertions, 37 deletions
diff --git a/.travis.yml b/.travis.yml
index 7c9aa0557..4684b3f4f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -42,6 +42,7 @@ matrix:
- 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 c648c128e..919f3eb3e 100644
--- a/Documentation/RelNotes/2.16.0.txt
+++ b/Documentation/RelNotes/2.16.0.txt
@@ -341,7 +341,7 @@ Fixes since v2.15
* 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 @@ Fixes since v2.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 @@ Fixes since v2.15
(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 3ef30922e..a1d0feca3 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -261,7 +261,7 @@ not a text/plain, it's something else.
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 9d1586b95..743af97b0 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -469,6 +469,12 @@ ifndef::git-format-patch[]
+
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 f850e8ffb..41585f535 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -118,7 +118,7 @@ OPTIONS
--[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 e55ac4cb6..258aff35c 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 bb5b7cdfb..1a9b23b67 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,6 @@ all::
# 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 @@ ifndef NO_OPENSSL
endif
else
BASIC_CFLAGS += -DNO_OPENSSL
- BLK_SHA1 = 1
OPENSSL_LIBSSL =
endif
ifdef NO_OPENSSL
diff --git a/bisect.c b/bisect.c
index 0fca17c02..2f3008b07 100644
--- a/bisect.c
+++ b/bisect.c
@@ -229,8 +229,10 @@ static struct commit_list *best_bisection_sorted(struct commit_list *list, int n
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 331d3eb3a..07f27c727 100755
--- a/ci/lib-travisci.sh
+++ b/ci/lib-travisci.sh
@@ -16,16 +16,77 @@ skip_branch_tip_with_tag () {
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 @@ linux-clang|linux-gcc)
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 8c8973cbf..4f261ddc0 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 e30fb2cdd..c19c50c1c 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 @@ test -z $HOST_UID || (CI_USER="ci" && useradd -u $HOST_UID $CI_USER) &&
# 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 0edf63acf..4f191c5bb 100755
--- a/ci/run-linux32-docker.sh
+++ b/ci/run-linux32-docker.sh
@@ -19,5 +19,10 @@ docker run \
--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 68dd0f080..fe4ee4e06 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 f0c743de9..22355f009 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 8757b3a97..d99a180e5 100755
--- a/ci/run-windows-build.sh
+++ b/ci/run-windows-build.sh
@@ -69,6 +69,10 @@ esac
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 @@ done
# 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 7a0a848e8..a20de9ca1 100755
--- a/ci/test-documentation.sh
+++ b/ci/test-documentation.sh
@@ -18,6 +18,9 @@ test -s Documentation/git.xml
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 @@ sed '/^GIT_VERSION = / d' stderr.log
! 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 2f55237e6..7f8415140 100644
--- a/configure.ac
+++ b/configure.ac
@@ -241,7 +241,6 @@ AC_MSG_NOTICE([CHECKS for site configuration])
# 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 ed24aa9d2..91c00e648 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -2501,9 +2501,28 @@ proc toggle_or_diff {mode w args} {
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 @@ proc toggle_or_diff {mode w args} {
}
}
- 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 4cae10a4c..68c4a6c73 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -698,6 +698,7 @@ proc apply_range_or_line {x y} {
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 b7f95672b..d47bd2959 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -392,9 +392,12 @@ pick_one_preserving_merges () {
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 780f81a8b..0fc580d8c 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1954,7 +1954,7 @@ int merge_trees(struct merge_options *o,
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 783abcecc..40ec5f87f 100644
--- a/oidset.h
+++ b/oidset.h
@@ -27,7 +27,7 @@ struct oidset {
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 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 &&