From 7c4d0219cf9ab6a7738a09ad7fec72d5e9f2ac67 Mon Sep 17 00:00:00 2001 From: Paul Talacko Date: Sat, 6 Sep 2008 18:50:38 -0700 Subject: [PATCH] git-svn: set auto_props when renaming files Patch-by: Paul Talacko : > Hello, > > There's an issue in git-svn as autoprops are not applied to > renamed files, only to added files. > > This patch fixes the bug. [ew: added test case] Signed-off-by: Eric Wong --- git-svn.perl | 1 + t/t9124-git-svn-dcommit-auto-props.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/git-svn.perl b/git-svn.perl index 2cc64876b2..ee3f5edb60 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -3657,6 +3657,7 @@ sub R { my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat, $self->url_path($m->{file_a}), $self->{r}); print "\tR\t$m->{file_a} => $m->{file_b}\n" unless $::_q; + $self->apply_autoprops($file, $fbat); $self->chg_file($fbat, $m); $self->close_file($fbat,undef,$self->{pool}); diff --git a/t/t9124-git-svn-dcommit-auto-props.sh b/t/t9124-git-svn-dcommit-auto-props.sh index 54276bf115..31193a382a 100755 --- a/t/t9124-git-svn-dcommit-auto-props.sh +++ b/t/t9124-git-svn-dcommit-auto-props.sh @@ -81,4 +81,21 @@ test_expect_success 'check resulting svn repository' ' ) ' +test_expect_success 'check renamed file' ' + test -d user && + generate_auto_props yes > user/config && + git mv foo foo.sh && + git commit -m "foo => foo.sh" && + git svn dcommit --config-dir=user && + ( + cd work/svnrepo && + svn up && + test ! -e foo && + test -e foo.sh && + test "x$(svn propget svn:mime-type foo.sh)" = \ + "xapplication/x-shellscript" && + test "x$(svn propget svn:eol-style foo.sh)" = "xLF" + ) +' + test_done