diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-08-25 00:57:59 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-08-25 11:59:55 +0100 |
commit | 683ef14506d9907dfa102b5e228637415c4922b6 (patch) | |
tree | 1194070744064e2e6f3b2e24203d77bbc65c56cb | |
parent | 4f8b1a2d11988e1b793149b3c7058e50b7d96f69 (diff) |
dgit: Introduce get_tree_of_commit
NFC
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-x | dgit | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -289,6 +289,14 @@ sub bpd_abs () { return $r; } +sub get_tree_of_commit ($) { + my ($commitish) = @_; + my $cdata = cmdoutput @git, qw(cat-file commit), $commitish; + $cdata =~ m/\n\n/; $cdata = $`; + $cdata =~ m/^tree (\w+)$/m or confess "cdata $cdata ?"; + return $1; +} + sub branch_gdr_info ($$) { my ($symref, $head) = @_; my ($status, $msg, $current, $ffq_prev, $gdrlast) = @@ -3164,10 +3172,7 @@ END # here we go, then: my $tree_commit = $mergeinputs[0]{Commit}; - my $tree = cmdoutput @git, qw(cat-file commit), $tree_commit; - $tree =~ m/\n\n/; $tree = $`; - $tree =~ m/^tree (\w+)$/m or die "$dsc_hash tree ?"; - $tree = $1; + my $tree = get_tree_of_commit $tree_commit;; # We use the changelog author of the package in question the # author of this pseudo-merge. This is (roughly) correct if |