diff options
author | eschnett <eschnett@83718e91-0e4f-0410-abf4-91180603181f> | 2011-01-26 21:59:53 +0000 |
---|---|---|
committer | eschnett <eschnett@83718e91-0e4f-0410-abf4-91180603181f> | 2011-01-26 21:59:53 +0000 |
commit | 45cd36d843be959ccf5996c71510a5d9bd09a334 (patch) | |
tree | 93a8d4ee7feabacbc7584ecee893338a87e49178 /src/util/git-add-thorn.pl | |
parent | c9841c474603a69eaaea629e8609b36d5469b4b4 (diff) |
Improve error output
git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@201 83718e91-0e4f-0410-abf4-91180603181f
Diffstat (limited to 'src/util/git-add-thorn.pl')
-rwxr-xr-x | src/util/git-add-thorn.pl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/util/git-add-thorn.pl b/src/util/git-add-thorn.pl index 98c7760..275d72d 100755 --- a/src/util/git-add-thorn.pl +++ b/src/util/git-add-thorn.pl @@ -32,7 +32,7 @@ $ENV{'GIT_DIR'} = "$git_repo/.git"; # links, and git refuses to follow them. Instad, we copy the whole # thorn (using hard links), and then add the copy. -# system "cd $git_root && $git_cmd add @files" or die; +# system "cd '$git_root' && $git_cmd add @files" or die; my $srcdir = $git_root; my $dstdir = "$scratch/tmp-$thorn"; @@ -51,10 +51,12 @@ for my $file (@files) { die "ERROR: Cannot create hard link from \"$srcdir/$file\" to \"$dstdir/$file\""; } -print "Executing: cd $dstdir && $git_cmd add @files\n" unless $silent; -system "cd $dstdir && $git_cmd add @files $silencer"; -if ($?) { - die "Could not add thorn $thorn to git repository"; +if (@files) { + print "Executing: cd '$dstdir' && $git_cmd add @files\n" unless $silent; + system "cd '$dstdir' && $git_cmd add @files $silencer"; + if ($?) { + die "Could not add thorn $thorn to git repository\nCommand was\n cd '$dstdir' && $git_cmd add @files"; + } } rmtree $dstdir or die; |