summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2d602e9)
raw | patch | inline | side by side (parent: 2d602e9)
author | Brian Gernhardt <benji@silverinsanity.com> | |
Thu, 19 Feb 2009 18:08:04 +0000 (13:08 -0500) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Mon, 23 Feb 2009 04:30:58 +0000 (20:30 -0800) |
Since SVN tracks empty directories and git does not, we can not assume
that the directory exists when creating .gitignore files.
Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
that the directory exists when creating .gitignore files.
Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index cbc5211d58a37f71b5c4566b9375ee398a1612ba..ef01fb93c27556c2061c2ed803fd6b7bfc556152 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
$gs->prop_walk($gs->{path}, $r, sub {
my ($gs, $path, $props) = @_;
# $path is of the form /path/to/dir/
- my $ignore = '.' . $path . '.gitignore';
+ $path = '.' . $path;
+ # SVN can have attributes on empty directories,
+ # which git won't track
+ mkpath([$path]) unless -d $path;
+ my $ignore = $path . '.gitignore';
my $s = $props->{'svn:ignore'} or return;
open(GITIGNORE, '>', $ignore)
or fatal("Failed to open `$ignore' for writing: $!");