From 80d8df0f5e830c4179dfa442528041b53a52b2f9 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Thu, 19 Apr 2012 10:26:19 -0700 Subject: [PATCH] [commit-patch] Only run the vc-add or remove commands when there are files to add or remove. --- commit-patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"; -- 2.51.2