From: Ian Jackson Date: Sun, 9 Nov 2014 23:27:13 +0000 (+0000) Subject: Break out git_write_tree (nfc) X-Git-Tag: debian/0.30~289 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=346892585656da58a8d913cf9f808872a3096823 Break out git_write_tree (nfc) --- diff --git a/dgit b/dgit index 87a03800..5c8d24a7 100755 --- 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); }