summaryrefslogtreecommitdiff
path: root/git-debrebase
diff options
context:
space:
mode:
Diffstat (limited to 'git-debrebase')
-rwxr-xr-xgit-debrebase9
1 files changed, 7 insertions, 2 deletions
diff --git a/git-debrebase b/git-debrebase
index 47411ac..01595c4 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -257,6 +257,12 @@ sub rm_subdir_cached ($) {
runcmd @git, qw(rm --quiet -rf --cached --ignore-unmatch), $subdir;
}
+sub read_tree_subdir ($$) {
+ my ($subdir, $new_tree_object) = @_;
+ rm_subdir_cached $subdir;
+ runcmd @git, qw(read-tree), "--prefix=$subdir/";
+}
+
# classify returns an info hash like this
# CommitId => $objid
# Hdr => # commit headers, including 1 final newline
@@ -642,8 +648,7 @@ sub walk ($;$$) {
my $read_tree_debian = sub {
my ($treeish) = @_;
- rm_subdir_cached qw(debian);
- runcmd @git, qw(read-tree --prefix=debian/), "$treeish:debian";
+ read_tree_subdir 'debian', "$treeish:debian";
};
my $read_tree_upstream = sub {
my ($treeish) = @_;