diff --git a/commit-patch b/commit-patch index fb6688d..5d55c2d 100755 --- a/commit-patch +++ b/commit-patch @@ -240,8 +240,8 @@ unless ($working_patch =~ /^\s*$/s) { # Work around an apparent bug in darcs (', \$out, '2>', \$err) or die "$out\n$err\n"; } run(["patch", $vc{patcharg}], '<', $patch, '>', \$out, '2>', \$err) or die "$out\n$err\n"; -run([split(/ /,$vc{add}), @added], '>', \$out, '2>', \$err) if ($#added >= 0 ); -run([split(/ /,$vc{remove}), @removed], '>', \$out, '2>', \$err) if ($#removed >= 0 ); +run([split(/ /,$vc{add}), @added], '>', \$out, '2>', \$err) if @added; +run([split(/ /,$vc{remove}), @removed], '>', \$out, '2>', \$err) if @removed; # Don't capture stdout or stderr because it can be interactive (cough cough darcs) run([split(/ /,$vc_commit), @message_opt, @added, @removed, @changed]) or die "commit failed.\n"; run(["patch", $vc{patcharg}], '<', \$non_committed_patch, '>', \$out, '2>', \$err) or die "$out\n$err\n";