summaryrefslogtreecommitdiff
path: root/t/t4204-patch-id.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-09-13 03:23:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-13 22:45:45 (GMT)
commit4a73aaaf18099ec1897330dd6c4a09f10ea2f573 (patch)
treef536c7e74925810fe3b58b1ec3e9c06495b4e903 /t/t4204-patch-id.sh
parent0e94ee9415e6cf6952b755347b57319e93356210 (diff)
downloadgit-4a73aaaf18099ec1897330dd6c4a09f10ea2f573.zip
git-4a73aaaf18099ec1897330dd6c4a09f10ea2f573.tar.gz
git-4a73aaaf18099ec1897330dd6c4a09f10ea2f573.tar.bz2
patch-id: use RUN_SETUP_GENTLY
Patch-id does not require a repository because it is just processing the incoming diff on stdin, but it may look at git config for keys like patchid.stable. Even though we do not setup_git_directory(), this works from the top-level of a repository because we blindly look at ".git/config" in this case. But as the included test demonstrates, it does not work from a subdirectory. We can fix it by using RUN_SETUP_GENTLY. We do not take any filenames from the user on the command line, so there's no need to adjust them via prefix_filename(). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4204-patch-id.sh')
-rwxr-xr-xt/t4204-patch-id.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh
index baa9d3c..10b6ad0 100755
--- a/t/t4204-patch-id.sh
+++ b/t/t4204-patch-id.sh
@@ -143,6 +143,20 @@ test_expect_success 'patch-id supports git-format-patch MIME output' '
test_cmp patch-id_master patch-id_same
'
+test_expect_success 'patch-id respects config from subdir' '
+ test_config patchid.stable true &&
+ mkdir subdir &&
+
+ # copy these because test_patch_id() looks for them in
+ # the current directory
+ cp bar-then-foo foo-then-bar subdir &&
+
+ (
+ cd subdir &&
+ test_patch_id irrelevant patchid.stable=true
+ )
+'
+
cat >nonl <<\EOF
diff --git i/a w/a
index e69de29..2e65efe 100644