aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2009-08-07 21:21:21 +0200
committerEric Wong <normalperson@yhbt.net>2009-08-10 02:35:55 -0700
commita7d72544b112f093b6189a86d05b198b2be73828 (patch)
treeb7e0e2fbfc87d053f190a953df4da1d44c40ce80 /git-svn.perl
parent63de84ad60984105b1cd60fb888968b352539313 (diff)
downloadgit-a7d72544b112f093b6189a86d05b198b2be73828.tar.gz
git-a7d72544b112f093b6189a86d05b198b2be73828.tar.xz
git-svn: ignore leading blank lines in svn:ignore
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>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-svn.perl b/git-svn.perl
index fa8583963..b0bfb7479 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -764,6 +764,7 @@ sub cmd_show_ignore {
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";
@@ -801,6 +802,7 @@ sub cmd_create_ignore {
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.