summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 63de84a)
raw | patch | inline | side by side (parent: 63de84a)
author | Michael Haggerty <mhagger@alum.mit.edu> | |
Fri, 7 Aug 2009 19:21:21 +0000 (21:21 +0200) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Mon, 10 Aug 2009 09:35:55 +0000 (02:35 -0700) |
Subversion ignores all blank lines in svn:ignore properties. The old
git-svn code ignored blank lines everywhere except for the first line
of the svn:ignore property. This patch makes the "git svn
show-ignore" and "git svn create-ignore" commands ignore leading blank
lines, too.
Also include leading blank lines in the test suite.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
git-svn code ignored blank lines everywhere except for the first line
of the svn:ignore property. This patch makes the "git svn
show-ignore" and "git svn create-ignore" commands ignore leading blank
lines, too.
Also include leading blank lines in the test suite.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history | |
t/t9101-git-svn-props.sh | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index fa8583963bcadf9330008049ef7dcf1cbd24722f..b0bfb74792d775155221bc857bb117479d3cbca2 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
print STDOUT "\n# $path\n";
my $s = $props->{'svn:ignore'} or return;
$s =~ s/[\r\n]+/\n/g;
+ $s =~ s/^\n+//;
chomp $s;
$s =~ s#^#$path#gm;
print STDOUT "$s\n";
open(GITIGNORE, '>', $ignore)
or fatal("Failed to open `$ignore' for writing: $!");
$s =~ s/[\r\n]+/\n/g;
+ $s =~ s/^\n+//;
chomp $s;
# Prefix all patterns so that the ignore doesn't apply
# to sub-directories.
index 9da4178c94f4bde62f69f32701b16ab3d04524e0..929499e996bc33d96ebab0b01ebcac8240e689b7 100755 (executable)
--- a/t/t9101-git-svn-props.sh
+++ b/t/t9101-git-svn-props.sh
touch deeply/nested/directory/.keep &&
svn_cmd add deeply &&
svn_cmd up &&
- svn_cmd propset -R svn:ignore 'no-such-file*' .
+ svn_cmd propset -R svn:ignore '
+no-such-file*
+' .
svn_cmd commit -m 'propset svn:ignore'
cd .. &&
git svn show-ignore > show-ignore.got &&
"
cat >prop.expect <<\EOF
+
no-such-file*
EOF