summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2017-06-01 23:50:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-02 01:58:25 (GMT)
commit177409e5897988f03e0c8111c94db6ea0466b138 (patch)
tree3065e4a03620792a5796e4ea27b1ea34f6d4e699 /t
parent6489660b4bba7456fac0d0a41f5d6295c5900c5f (diff)
downloadgit-177409e5897988f03e0c8111c94db6ea0466b138.zip
git-177409e5897988f03e0c8111c94db6ea0466b138.tar.gz
git-177409e5897988f03e0c8111c94db6ea0466b138.tar.bz2
send-email: check for repo before invoking hook
Unless --no-validate is passed, send-email will invoke $repo->repo_path() in its search for a validate hook regardless of whether a Git repo is actually present. Teach send-email to first check for repo existence. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t9001-send-email.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 15128c7..d1e4e8a 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -1953,4 +1953,12 @@ test_expect_success $PREREQ 'invoke hook' '
)
'
+test_expect_success $PREREQ 'test that send-email works outside a repo' '
+ nongit git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ "$(pwd)/0001-add-master.patch"
+'
+
test_done