diff options
| -rwxr-xr-x | scripts/send-pull-request | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/send-pull-request b/scripts/send-pull-request index 5a11d1f1e6..21eb302169 100755 --- a/scripts/send-pull-request +++ b/scripts/send-pull-request | |||
| @@ -41,6 +41,18 @@ harvest_recipients() | |||
| 41 | unset IFS | 41 | unset IFS |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | check_git_sendemail_config() | ||
| 45 | { | ||
| 46 | GIT_SMTP=$(git config sendemail.smtpserver) | ||
| 47 | GIT_FROM=$(git config sendemail.from) | ||
| 48 | if [ -z "$GIT_SMTP" ] || [ -z "$GIT_FROM" ]; then | ||
| 49 | echo "ERROR: git sendemail is not configured." | ||
| 50 | echo "Please read GIT-SEND-EMAIL(1) and configure:" | ||
| 51 | echo " sendemail.smtpserver" | ||
| 52 | echo " sendemail.from" | ||
| 53 | exit 1 | ||
| 54 | fi | ||
| 55 | } | ||
| 44 | 56 | ||
| 45 | # Parse and verify arguments | 57 | # Parse and verify arguments |
| 46 | while getopts "achp:t:" OPT; do | 58 | while getopts "achp:t:" OPT; do |
| @@ -74,6 +86,9 @@ while getopts "achp:t:" OPT; do | |||
| 74 | esac | 86 | esac |
| 75 | done | 87 | done |
| 76 | 88 | ||
| 89 | # Abort early if git-send-email is not properly configured | ||
| 90 | check_git_sendemail_config | ||
| 91 | |||
| 77 | if [ -z "$PDIR" ]; then | 92 | if [ -z "$PDIR" ]; then |
| 78 | echo "ERROR: you must specify a pull-dir." | 93 | echo "ERROR: you must specify a pull-dir." |
| 79 | usage | 94 | usage |
