@matheusbsbs / matheus-bagliano / commits / 7c4d0219cf
Fork 0

git-svn: set auto_props when renaming files

Patch-by: Paul Talacko <gnuruandstuff@yahoo.co.uk>: <http://article.gmane.org/gmane.comp.version-control.git/95006> > 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 <normalperson@yhbt.net>

Paul Talacko committed Sep 6, 2008 at 18:50 UTC 7c4d0219cf9ab6a7738a09ad7fec72d5e9f2ac67
2 files changed +18
git-svn.perl
+1
@@ -3657,6 +3657,7 @@ sub R {
3657 my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
3658 $self->url_path($m->{file_a}), $self->{r});
3659 print "\tR\t$m->{file_a} => $m->{file_b}\n" unless $::_q;
3660 + $self->apply_autoprops($file, $fbat);
3661 $self->chg_file($fbat, $m);
3662 $self->close_file($fbat,undef,$self->{pool});
3663
t/t9124-git-svn-dcommit-auto-props.sh
+17
@@ -81,4 +81,21 @@ test_expect_success 'check resulting svn repository' '
81 )
82 '
83
84 +test_expect_success 'check renamed file' '
85 + test -d user &&
86 + generate_auto_props yes > user/config &&
87 + git mv foo foo.sh &&
88 + git commit -m "foo => foo.sh" &&
89 + git svn dcommit --config-dir=user &&
90 + (
91 + cd work/svnrepo &&
92 + svn up &&
93 + test ! -e foo &&
94 + test -e foo.sh &&
95 + test "x$(svn propget svn:mime-type foo.sh)" = \
96 + "xapplication/x-shellscript" &&
97 + test "x$(svn propget svn:eol-style foo.sh)" = "xLF"
98 + )
99 +'
100 +
101 test_done