summaryrefslogtreecommitdiff
path: root/t/t7600-merge.sh
diff options
context:
space:
mode:
authorLibravatar Jiang Xin <worldhello.net@gmail.com>2021-08-14 07:56:22 +0800
committerLibravatar Jiang Xin <worldhello.net@gmail.com>2021-08-14 07:56:22 +0800
commit117e2caa42210de5c2c1ecfdf5d2bda056cd6f00 (patch)
treec742277e7f21ad2746a807e2c0318a0fae662f5f /t/t7600-merge.sh
parentMerge branch 'master' of github.com:nafmo/git-l10n-sv (diff)
parentGit 2.33-rc2 (diff)
downloadtgif-117e2caa42210de5c2c1ecfdf5d2bda056cd6f00.tar.xz
Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git: (51 commits) Git 2.33-rc2 object-file: use unsigned arithmetic with bit mask Revert 'diff-merges: let "-m" imply "-p"' object-store: avoid extra ';' from KHASH_INIT oidtree: avoid nested struct oidtree_node Git 2.33-rc1 test: fix for COLUMNS and bash 5 The eighth batch diff: --pickaxe-all typofix mingw: align symlinks-related rmdir() behavior with Linux t7508: avoid non POSIX BRE use fspathhash() everywhere t0001: fix broken not-quite getcwd(3) test in bed67874e2 Documentation: render special characters correctly reset: clear_unpack_trees_porcelain to plug leak builtin/rebase: fix options.strategy memory lifecycle builtin/merge: free found_ref when done builtin/mv: free or UNLEAK multiple pointers at end of cmd_mv convert: release strbuf to avoid leak read-cache: call diff_setup_done to avoid leak ...
Diffstat (limited to 't/t7600-merge.sh')
-rwxr-xr-xt/t7600-merge.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 1cbc9715a8..2ef39d3088 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -122,6 +122,8 @@ test_expect_success 'setup' '
c0=$(git rev-parse HEAD) &&
cp file.1 file &&
git add file &&
+ cp file.1 other &&
+ git add other &&
test_tick &&
git commit -m "commit 1" &&
git tag c1 &&
@@ -711,6 +713,15 @@ test_expect_success 'fast-forward merge with --autostash' '
test_cmp result.1-5 file
'
+test_expect_success 'failed fast-forward merge with --autostash' '
+ git reset --hard c0 &&
+ git merge-file file file.orig file.5 &&
+ cp file.5 other &&
+ test_must_fail git merge --autostash c1 2>err &&
+ test_i18ngrep "Applied autostash." err &&
+ test_cmp file.5 file
+'
+
test_expect_success 'octopus merge with --autostash' '
git reset --hard c1 &&
git merge-file file file.orig file.3 &&
@@ -721,6 +732,14 @@ test_expect_success 'octopus merge with --autostash' '
test_cmp result.1-3-5-9 file
'
+test_expect_success 'failed merge (exit 2) with --autostash' '
+ git reset --hard c1 &&
+ git merge-file file file.orig file.5 &&
+ test_must_fail git merge -s recursive --autostash c2 c3 2>err &&
+ test_i18ngrep "Applied autostash." err &&
+ test_cmp result.1-5 file
+'
+
test_expect_success 'conflicted merge with --autostash, --abort restores stash' '
git reset --hard c3 &&
cp file.1 file &&