summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-08-25 00:57:59 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-08-25 11:59:55 +0100
commit683ef14506d9907dfa102b5e228637415c4922b6 (patch)
tree1194070744064e2e6f3b2e24203d77bbc65c56cb /dgit
parent4f8b1a2d11988e1b793149b3c7058e50b7d96f69 (diff)
dgit: Introduce get_tree_of_commit
NFC Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit13
1 files changed, 9 insertions, 4 deletions
diff --git a/dgit b/dgit
index 0374b47..3438f62 100755
--- a/dgit
+++ b/dgit
@@ -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