-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-send-email: Respect core.hooksPath setting
get-send-email currently makes the assumption that the 'sendemail-validate' hook exists inside of the repository. Since the introduction of 'core.hooksPath' configuration option in 867ad08 (hooks: allow customizing where the hook directory is, 2016-05-04), this is no longer true. Instead of assuming a hardcoded repo relative path, query git for the actual path of the hooks directory. Signed-off-by: Robert Foss <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
- Loading branch information
1 parent
1424303
commit c824393
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -513,6 +513,38 @@ do | |
|
||
done | ||
|
||
test_expect_success $PREREQ "--validate respects relative core.hooksPath path" ' | ||
clean_fake_sendmail && | ||
mkdir my-hooks && | ||
test_when_finished "rm my-hooks.ran" && | ||
write_script my-hooks/sendemail-validate <<-\EOF && | ||
>my-hooks.ran | ||
exit 1 | ||
EOF | ||
test_config core.hooksPath "my-hooks" && | ||
test_must_fail git send-email \ | ||
--from="Example <[email protected]>" \ | ||
[email protected] \ | ||
--smtp-server="$(pwd)/fake.sendmail" \ | ||
--validate \ | ||
longline.patch 2>err && | ||
test_path_is_file my-hooks.ran && | ||
grep "rejected by sendemail-validate" err | ||
' | ||
|
||
test_expect_success $PREREQ "--validate respects absolute core.hooksPath path" ' | ||
test_config core.hooksPath "$(pwd)/my-hooks" && | ||
test_when_finished "rm my-hooks.ran" && | ||
test_must_fail git send-email \ | ||
--from="Example <[email protected]>" \ | ||
[email protected] \ | ||
--smtp-server="$(pwd)/fake.sendmail" \ | ||
--validate \ | ||
longline.patch 2>err && | ||
test_path_is_file my-hooks.ran && | ||
grep "rejected by sendemail-validate" err | ||
' | ||
|
||
for enc in 7bit 8bit quoted-printable base64 | ||
do | ||
test_expect_success $PREREQ "--transfer-encoding=$enc produces correct header" ' | ||
|