summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-04-27 11:36:41 -0700
committerJunio C Hamano <gitster@pobox.com>2011-04-27 11:36:41 -0700
commit698a9ab3f104b369e41ad26ad0bdaedc3a1d5f4f (patch)
treef8f4caee7105d8c1a03aa68ae7a5b1428c2dc337 /git-svn.perl
parent95fd6e21f1e7656d3760346ec08b2d43133cba9c (diff)
parent55f9d7a75c90ca98f7d7be32e9bdca5a789d1257 (diff)
downloadgit-698a9ab3f104b369e41ad26ad0bdaedc3a1d5f4f.tar.gz
Merge branch 'mh/git-svn-automkdirs'
* mh/git-svn-automkdirs: git-svn: add an option to skip the creation of empty directories
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl17
1 files changed, 15 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index bf0451b468..0fd2fd2188 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -784,6 +784,15 @@ sub cmd_find_rev {
print "$result\n" if $result;
}
+sub auto_create_empty_directories {
+ my ($gs) = @_;
+ my $var = eval { command_oneline('config', '--get', '--bool',
+ "svn-remote.$gs->{repo_id}.automkdirs") };
+ # By default, create empty directories by consulting the unhandled log,
+ # but allow setting it to 'false' to skip it.
+ return !($var && $var eq 'false');
+}
+
sub cmd_rebase {
command_noisy(qw/update-index --refresh/);
my ($url, $rev, $uuid, $gs) = working_head_info('HEAD');
@@ -807,7 +816,9 @@ sub cmd_rebase {
$_fetch_all ? $gs->fetch_all : $gs->fetch;
}
command_noisy(rebase_cmd(), $gs->refname);
- $gs->mkemptydirs;
+ if (auto_create_empty_directories($gs)) {
+ $gs->mkemptydirs;
+ }
}
sub cmd_show_ignore {
@@ -1245,7 +1256,9 @@ sub post_fetch_checkout {
command_noisy(qw/read-tree -m -u -v HEAD HEAD/);
print STDERR "Checked out HEAD:\n ",
$gs->full_url, " r", $gs->last_rev, "\n";
- $gs->mkemptydirs($gs->last_rev);
+ if (auto_create_empty_directories($gs)) {
+ $gs->mkemptydirs($gs->last_rev);
+ }
}
sub complete_svn_url {