Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Do not over-quote the -f envelopesender value.
  unexpected Make output (e.g. from --debug) causes build failure
  Fixed minor typo in t/t9001-send-email.sh test command line.
  • Loading branch information
Junio C Hamano committed Sep 25, 2007
2 parents bc12651 + d1637a0 commit 41ef95a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ perl/perl.mak: GIT-CFLAGS

$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
$(QUIET_GEN)$(RM) $@ $@+ && \
INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \
sed -e '1{' \
-e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
-e ' h' \
Expand Down
16 changes: 10 additions & 6 deletions contrib/hooks/post-receive-email
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,15 @@ generate_delete_general_email()
echo $LOGEND
}

send_mail()
{
if [ -n "$envelopesender" ]; then
/usr/sbin/sendmail -t -f "$envelopesender"
else
/usr/sbin/sendmail -t
fi
}

# ---------------------------- main()

# --- Constants
Expand Down Expand Up @@ -607,13 +616,8 @@ if [ -n "$1" -a -n "$2" -a -n "$3" ]; then
# resend an email; they could redirect the output to sendmail themselves
PAGER= generate_email $2 $3 $1
else
if [ -n "$envelopesender" ]; then
envelopesender="-f '$envelopesender'"
fi

while read oldrev newrev refname
do
generate_email $oldrev $newrev $refname |
/usr/sbin/sendmail -t $envelopesender
generate_email $oldrev $newrev $refname | send_mail
done
fi
2 changes: 1 addition & 1 deletion t/t9001-send-email.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test_expect_success 'Extract patches' '
'

test_expect_success 'Send patches' '
git send-email -from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
git send-email --from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
'

cat >expected <<\EOF
Expand Down

0 comments on commit 41ef95a

Please sign in to comment.