chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b8d3ae
)
Break out git_write_tree (nfc)
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 9 Nov 2014 23:27:13 +0000
(23:27 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 9 Nov 2014 23:27:13 +0000
(23:27 +0000)
dgit
patch
|
blob
|
history
diff --git
a/dgit
b/dgit
index 87a038009a006ad1feaa5d28b7721caa122f7959..5c8d24a7908eb891ef1ebf5765593100683f47e7 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-1047,6
+1047,12
@@
sub mktree_in_ud_here () {
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) = <*/.>;
@@
-1061,8
+1067,7
@@
sub mktree_in_ud_from_only_subdir () {
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);
}