chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make fail() cope with multi-line messages
[dgit.git]
/
dgit
diff --git
a/dgit
b/dgit
index 87a038009a006ad1feaa5d28b7721caa122f7959..2056818baa4cb07fa6a4e57b4253151d85cd5c10 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-163,7
+163,10
@@
sub waitstatusmsg () {
sub printdebug { print DEBUG $debugprefix, @_ or die $!; }
sub fail {
sub printdebug { print DEBUG $debugprefix, @_ or die $!; }
sub fail {
- die $us.($we_are_responder ? " (build host)" : "").": @_\n";
+ my $s = "@_\n";
+ my $prefix = $us.($we_are_responder ? " (build host)" : "").": ";
+ $s =~ s/^/$prefix/gm;
+ die $s;
}
sub badcfg { print STDERR "$us: invalid configuration: @_\n"; exit 12; }
}
sub badcfg { print STDERR "$us: invalid configuration: @_\n"; exit 12; }
@@
-1047,6
+1050,12
@@
sub mktree_in_ud_here () {
symlink '../../../../objects','.git/objects' or die $!;
}
symlink '../../../../objects','.git/objects' or die $!;
}
+sub git_write_tree () {
+ my $tree = cmdoutput @git, qw(write-tree);
+ $tree =~ m/^\w+$/ or die "$tree ?";
+ return $tree;
+}
+
sub mktree_in_ud_from_only_subdir () {
# changes into the subdir
my (@dirs) = <*/.>;
sub mktree_in_ud_from_only_subdir () {
# changes into the subdir
my (@dirs) = <*/.>;
@@
-1061,8
+1070,7
@@
sub mktree_in_ud_from_only_subdir () {
rmtree '.pc';
}
runcmd @git, qw(add -Af);
rmtree '.pc';
}
runcmd @git, qw(add -Af);
- my $tree = cmdoutput @git, qw(write-tree);
- $tree =~ m/^\w+$/ or die "$tree ?";
+ my $tree=git_write_tree();
return ($tree,$dir);
}
return ($tree,$dir);
}