From: Martin Mares Date: Fri, 10 Aug 2012 14:59:29 +0000 (+0200) Subject: update2: Save original STDIN X-Git-Tag: v1.1~6 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=f5f4b72a7cc55dc16ef6cedc7bc21c285016755c;p=git-tools.git update2: Save original STDIN Otherwise, a change of multiple branches sends only one mail, because our invocation of mutt replaces STDIN. --- diff --git a/update2 b/update2 index 5d30726..7d62853 100755 --- a/update2 +++ b/update2 @@ -36,12 +36,13 @@ my @diff_options = ('-C'); sub update_ref($$$); +open ORIG_STDIN, '<&', \*STDIN; open ORIG_STDOUT, '>&', \*STDOUT; if (@ARGV) { update_ref($ARGV[0], $ARGV[1], $ARGV[2]); } else { - while () { + while () { chomp; my ($old, $new, $ref) = /^(\S+) (\S+) (.*)/ or die "Error parsing hook input ($_)\n"; update_ref($ref, $old, $new);