diff options
Diffstat (limited to 'git-debrebase')
-rwxr-xr-x | git-debrebase | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/git-debrebase b/git-debrebase index d0fc8fd..10dadc5 100755 --- a/git-debrebase +++ b/git-debrebase @@ -2407,12 +2407,17 @@ sub make_patches_staged ($) { sub make_patches ($) { my ($head) = @_; keycommits $head, 0, \&snag; - make_patches_staged $head; + my $any = make_patches_staged $head; my $out; in_workarea sub { - my $ptree = cmdoutput @git, qw(write-tree --prefix=debian/patches/); + my $ptree = !$any ? undef : + cmdoutput @git, qw(write-tree --prefix=debian/patches/); runcmd @git, qw(read-tree), $head; - read_tree_subdir 'debian/patches', $ptree; + if ($ptree) { + read_tree_subdir 'debian/patches', $ptree; + } else { + rm_subdir_cached 'debian/patches'; + } $out = make_commit [$head], [ 'Commit patch queue (exported by git-debrebase)', '[git-debrebase make-patches: export and commit patches]', |