chiark / gitweb /
git-debrebase: read_tree_upstream: New option $keep_patches
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 10 Aug 2018 14:25:31 +0000 (15:25 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 09:01:47 +0000 (10:01 +0100)
NFC with existing callers.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index ad20e4b..66cbb58 100755 (executable)
@@ -261,12 +261,12 @@ sub read_tree_debian ($) {
     rm_subdir_cached 'debian/patches';
 }
 
-sub read_tree_upstream ($) {
-    my ($treeish) = @_;
+sub read_tree_upstream ($;$) {
+    my ($treeish, $keep_patches) = @_;
     my $save = cmdoutput @git, qw(write-tree --prefix=debian/);
     runcmd @git, qw(read-tree), $treeish;
     read_tree_subdir 'debian', $save;
-    rm_subdir_cached 'debian/patches';
+    rm_subdir_cached 'debian/patches' unless $keep_patches;
 };
 
 sub make_commit ($$) {