summaryrefslogtreecommitdiff
path: root/t/t6426-merge-skip-unneeded-updates.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t6426-merge-skip-unneeded-updates.sh')
-rwxr-xr-xt/t6426-merge-skip-unneeded-updates.sh95
1 files changed, 46 insertions, 49 deletions
diff --git a/t/t6426-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh
index 6998136..b059475 100755
--- a/t/t6426-merge-skip-unneeded-updates.sh
+++ b/t/t6426-merge-skip-unneeded-updates.sh
@@ -23,6 +23,7 @@ test_description="merge cases"
# files that might be renamed into each other's paths.)
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-merge.sh
###########################################################################
@@ -37,7 +38,7 @@ test_description="merge cases"
# Expected: b_2
test_setup_1a () {
- test_create_repo 1a_$1 &&
+ git init 1a_$1 &&
(
cd 1a_$1 &&
@@ -135,7 +136,7 @@ test_expect_success '1a-R: Modify(A)/Modify(B), change on B subset of A' '
# Expected: c_2
test_setup_2a () {
- test_create_repo 2a_$1 &&
+ git init 2a_$1 &&
(
cd 2a_$1 &&
@@ -228,7 +229,7 @@ test_expect_success '2a-R: Modify/rename, merge into rename side' '
# Expected: c_2
test_setup_2b () {
- test_create_repo 2b_$1 &&
+ git init 2b_$1 &&
(
cd 2b_$1 &&
@@ -335,7 +336,7 @@ test_expect_success '2b-R: Rename+Mod(A)/Mod(B), B mods subset of A' '
# not make that particular mistake.
test_setup_2c () {
- test_create_repo 2c &&
+ git init 2c &&
(
cd 2c &&
@@ -374,45 +375,33 @@ test_expect_success '2c: Modify b & add c VS rename b->c' '
export GIT_MERGE_VERBOSITY &&
test_must_fail git merge -s recursive B^0 >out 2>err &&
- test_i18ngrep "CONFLICT (.*/add):" out &&
+ test_grep "CONFLICT (.*/add):" out &&
test_must_be_empty err &&
- # Make sure c WAS updated
+ git ls-files -s >index_files &&
+ test_line_count = 2 index_files &&
+
+ # Ensure b was removed
+ test_path_is_missing b &&
+
+ # Make sure c WAS updated...
test-tool chmtime --get c >new-mtime &&
- test $(cat old-mtime) -lt $(cat new-mtime)
-
- # FIXME: rename/add conflicts are horribly broken right now;
- # when I get back to my patch series fixing it and
- # rename/rename(2to1) conflicts to bring them in line with
- # how add/add conflicts behave, then checks like the below
- # could be added. But that patch series is waiting until
- # the rename-directory-detection series lands, which this
- # is part of. And in the mean time, I do not want to further
- # enforce broken behavior. So for now, the main test is the
- # one above that err is an empty file.
-
- #git ls-files -s >index_files &&
- #test_line_count = 2 index_files &&
-
- #git rev-parse >actual :2:c :3:c &&
- #git rev-parse >expect A:b A:c &&
- #test_cmp expect actual &&
-
- #git cat-file -p A:b >>merged &&
- #git cat-file -p A:c >>merge-me &&
- #>empty &&
- #test_must_fail git merge-file \
- # -L "Temporary merge branch 1" \
- # -L "" \
- # -L "Temporary merge branch 2" \
- # merged empty merge-me &&
- #sed -e "s/^\([<=>]\)/\1\1\1/" merged >merged-internal &&
-
- #git hash-object c >actual &&
- #git hash-object merged-internal >expect &&
- #test_cmp expect actual &&
-
- #test_path_is_missing b
+ test $(cat old-mtime) -lt $(cat new-mtime) &&
+
+ # ...and has correct index entries and working tree contents
+ git rev-parse >actual :2:c :3:c &&
+ git rev-parse >expect A:c A:b &&
+ test_cmp expect actual &&
+
+ git cat-file -p A:b >>merge-me &&
+ git cat-file -p A:c >>merged &&
+ >empty &&
+ test_must_fail git merge-file \
+ -L "HEAD" \
+ -L "" \
+ -L "B^0" \
+ merged empty merge-me &&
+ test_cmp merged c
)
'
@@ -436,7 +425,7 @@ test_expect_success '2c: Modify b & add c VS rename b->c' '
# Expected: bar/{bq_2, whatever}
test_setup_3a () {
- test_create_repo 3a_$1 &&
+ git init 3a_$1 &&
(
cd 3a_$1 &&
@@ -491,7 +480,9 @@ test_expect_success '3a-L: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'
@@ -521,7 +512,9 @@ test_expect_success '3a-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'
@@ -532,7 +525,7 @@ test_expect_success '3a-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
# Expected: bar/{bq_2, whatever}
test_setup_3b () {
- test_create_repo 3b_$1 &&
+ git init 3b_$1 &&
(
cd 3b_$1 &&
@@ -587,7 +580,9 @@ test_expect_success '3b-L: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'
@@ -617,7 +612,9 @@ test_expect_success '3b-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'
@@ -633,7 +630,7 @@ test_expect_success '3b-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
# Expected: b_2 for merge, b_4 in working copy
test_setup_4a () {
- test_create_repo 4a &&
+ git init 4a &&
(
cd 4a &&
@@ -666,7 +663,7 @@ test_setup_4a () {
# correct requires doing the merge in-memory first, then realizing that no
# updates to the file are necessary, and thus that we can just leave the path
# alone.
-test_expect_failure '4a: Change on A, change on B subset of A, dirty mods present' '
+test_expect_merge_algorithm failure success '4a: Change on A, change on B subset of A, dirty mods present' '
test_setup_4a &&
(
cd 4a &&
@@ -705,7 +702,7 @@ test_expect_failure '4a: Change on A, change on B subset of A, dirty mods presen
# Expected: c_2
test_setup_4b () {
- test_create_repo 4b &&
+ git init 4b &&
(
cd 4b &&