credential-libsecret: unlock locked secrets
[gitweb.git] / t / t7610-mergetool.sh
index 7217f3968d51d9061b14bd46c473329b26bb087c..63d36fb28e44426708a743979c4bc341bdac714e 100755 (executable)
@@ -591,7 +591,8 @@ test_expect_success 'filenames seen by tools start with ./' '
 
 test_lazy_prereq MKTEMP '
        tempdir=$(mktemp -d -t foo.XXXXXX) &&
-       test -d "$tempdir"
+       test -d "$tempdir" &&
+       rmdir "$tempdir"
 '
 
 test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToTemp' '
@@ -606,4 +607,64 @@ test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToT
        git reset --hard master >/dev/null 2>&1
 '
 
+test_expect_success 'diff.orderFile configuration is honored' '
+       test_config diff.orderFile order-file &&
+       test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
+       test_config mergetool.myecho.trustExitCode true &&
+       echo b >order-file &&
+       echo a >>order-file &&
+       git checkout -b order-file-start master &&
+       echo start >a &&
+       echo start >b &&
+       git add a b &&
+       git commit -m start &&
+       git checkout -b order-file-side1 order-file-start &&
+       echo side1 >a &&
+       echo side1 >b &&
+       git add a b &&
+       git commit -m side1 &&
+       git checkout -b order-file-side2 order-file-start &&
+       echo side2 >a &&
+       echo side2 >b &&
+       git add a b &&
+       git commit -m side2 &&
+       test_must_fail git merge order-file-side1 &&
+       cat >expect <<-\EOF &&
+               Merging:
+               b
+               a
+       EOF
+       git mergetool --no-prompt --tool myecho >output &&
+       git grep --no-index -h -A2 Merging: output >actual &&
+       test_cmp expect actual &&
+       git reset --hard >/dev/null
+'
+test_expect_success 'mergetool -Oorder-file is honored' '
+       test_config diff.orderFile order-file &&
+       test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
+       test_config mergetool.myecho.trustExitCode true &&
+       test_must_fail git merge order-file-side1 &&
+       cat >expect <<-\EOF &&
+               Merging:
+               a
+               b
+       EOF
+       git mergetool -O/dev/null --no-prompt --tool myecho >output &&
+       git grep --no-index -h -A2 Merging: output >actual &&
+       test_cmp expect actual &&
+       git reset --hard >/dev/null 2>&1 &&
+
+       git config --unset diff.orderFile &&
+       test_must_fail git merge order-file-side1 &&
+       cat >expect <<-\EOF &&
+               Merging:
+               b
+               a
+       EOF
+       git mergetool -Oorder-file --no-prompt --tool myecho >output &&
+       git grep --no-index -h -A2 Merging: output >actual &&
+       test_cmp expect actual &&
+       git reset --hard >/dev/null 2>&1
+'
+
 test_done