diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-01-24 16:30:45 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-16 12:25:49 +0100 |
commit | 24b80ade5059ef25fd0381078e04d4eebb7eae5c (patch) | |
tree | c8575292fad3808560f0d75b8aacea73190c4a7d /git-debrebase | |
parent | 825270a6f7b5506c9bb5f444243da7c831408f54 (diff) |
git-debrebase: break out rm_subdir_cached (nfc)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debrebase')
-rwxr-xr-x | git-debrebase | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/git-debrebase b/git-debrebase index b273938..47411ac 100755 --- a/git-debrebase +++ b/git-debrebase @@ -252,6 +252,11 @@ sub calculate_committer_authline () { return $&; } +sub rm_subdir_cached ($) { + my ($subdir) = @_; + runcmd @git, qw(rm --quiet -rf --cached --ignore-unmatch), $subdir; +} + # classify returns an info hash like this # CommitId => $objid # Hdr => # commit headers, including 1 final newline @@ -635,13 +640,9 @@ sub walk ($;$$) { my $rewriting = 0; - my $rm_tree_cached = sub { - my ($subdir) = @_; - runcmd @git, qw(rm --quiet -rf --cached --ignore-unmatch), $subdir; - }; my $read_tree_debian = sub { my ($treeish) = @_; - $rm_tree_cached->(qw(debian)); + rm_subdir_cached qw(debian); runcmd @git, qw(read-tree --prefix=debian/), "$treeish:debian"; }; my $read_tree_upstream = sub { @@ -684,7 +685,7 @@ sub walk ($;$$) { next; } elsif ($method eq 'DgitImportDebianUpdate') { $read_tree_debian->($cltree); - $rm_tree_cached->(qw(debian/patches)); + rm_subdir_cached qw(debian/patches); } elsif ($method eq 'DgitImportUpstreamUpdate') { $read_tree_upstream->($cltree); push @parents, map { $_->{CommitId} } @{ $cl->{OrigParents} }; |