diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-12-22 06:59:37 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-08 02:19:34 +0300 |
commit | 0d3979c175054187a4bd94dbbdc4f99300f7fc04 (patch) | |
tree | 9e89dd54a2e0b2776d504de9ca9d9fb6a66c450d /t/t1800-hook.sh | |
parent | 1a3017d908824ab42ca7a5af7073f4cdc5c88fbf (diff) |
git hook run: add an --ignore-missing flag
For certain one-shot hooks we'd like to optimistically run them, and
not complain if they don't exist.
This was already supported by the underlying hook.c library, but had
not been exposed via "git hook run". The command version of this will
be used by send-email in a subsequent commit.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1800-hook.sh')
-rwxr-xr-x | t/t1800-hook.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t1800-hook.sh b/t/t1800-hook.sh index 3aea1b105f..29718aa991 100755 --- a/t/t1800-hook.sh +++ b/t/t1800-hook.sh @@ -21,6 +21,11 @@ test_expect_success 'git hook run: nonexistent hook' ' test_cmp stderr.expect stderr.actual ' +test_expect_success 'git hook run: nonexistent hook with --ignore-missing' ' + git hook run --ignore-missing does-not-exist 2>stderr.actual && + test_must_be_empty stderr.actual +' + test_expect_success 'git hook run: basic' ' write_script .git/hooks/test-hook <<-EOF && echo Test hook |