summaryrefslogtreecommitdiff
path: root/git-debrebase
diff options
context:
space:
mode:
Diffstat (limited to 'git-debrebase')
-rwxr-xr-xgit-debrebase13
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} };