]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t4014-format-patch.sh
The sixth batch
[thirdparty/git.git] / t / t4014-format-patch.sh
index db7e733af9e5be1abe8991e1513f9d31949433f4..958c2da56ec662ce59541f5560637ded269ff83b 100755 (executable)
@@ -81,16 +81,16 @@ test_expect_success 'format-patch --ignore-if-in-upstream handles tags' '
 '
 
 test_expect_success "format-patch doesn't consider merge commits" '
-       git checkout -b slave master &&
+       git checkout -b feature master &&
        echo "Another line" >>file &&
        test_tick &&
-       git commit -am "Slave change #1" &&
+       git commit -am "Feature branch change #1" &&
        echo "Yet another line" >>file &&
        test_tick &&
-       git commit -am "Slave change #2" &&
+       git commit -am "Feature branch change #2" &&
        git checkout -b merger master &&
        test_tick &&
-       git merge --no-ff slave &&
+       git merge --no-ff feature &&
        git format-patch -3 --stdout >patch &&
        grep "^From " patch >from &&
        test_line_count = 3 from
@@ -1602,6 +1602,19 @@ test_expect_success 'format patch ignores color.ui' '
        test_cmp expect actual
 '
 
+test_expect_success 'format patch respects diff.relative' '
+       rm -rf subdir &&
+       mkdir subdir &&
+       echo other content >subdir/file2 &&
+       git add subdir/file2 &&
+       git commit -F msg &&
+       test_unconfig diff.relative &&
+       git format-patch --relative=subdir --stdout -1 >expect &&
+       test_config diff.relative true &&
+       git -C subdir format-patch --stdout -1 >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success 'cover letter with invalid --cover-from-description and config' '
        test_config branch.rebuild-1.description "config subject