chiark / gitweb /
New import: mktree_in_ud_from_only_subdir: New $raw parameter (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 28 Sep 2016 23:33:03 +0000 (00:33 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Oct 2016 14:55:09 +0000 (15:55 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index cdf2e93b2e56e5325a1ee2a03f0626cd46b0c229..b1883614adfb61cb049d172302bd7ef254aa55e0 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1374,7 +1374,9 @@ sub remove_stray_gits () {
     $!=0; $?=0; close GITS or failedcmd @gitscmd;
 }
 
-sub mktree_in_ud_from_only_subdir () {
+sub mktree_in_ud_from_only_subdir (;$) {
+    my ($raw) = @_;
+
     # changes into the subdir
     my (@dirs) = <*/.>;
     die "@dirs ?" unless @dirs==1;
@@ -1384,10 +1386,13 @@ sub mktree_in_ud_from_only_subdir () {
 
     remove_stray_gits();
     mktree_in_ud_here();
-    my ($format, $fopts) = get_source_format();
-    if (madformat($format)) {
-       rmtree '.pc';
+    if (!$raw) {
+       my ($format, $fopts) = get_source_format();
+       if (madformat($format)) {
+           rmtree '.pc';
+       }
     }
+
     runcmd @git, qw(add -Af);
     my $tree=git_write_tree();
     return ($tree,$dir);