Skip to content

Commit 7c4d021

Browse files
Paul TalackoEric Wong
authored andcommitted
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>
1 parent a786091 commit 7c4d021

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

git-svn.perl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3657,6 +3657,7 @@ sub R {
36573657
my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
36583658
$self->url_path($m->{file_a}), $self->{r});
36593659
print "\tR\t$m->{file_a} => $m->{file_b}\n" unless $::_q;
3660+
$self->apply_autoprops($file, $fbat);
36603661
$self->chg_file($fbat, $m);
36613662
$self->close_file($fbat,undef,$self->{pool});
36623663

t/t9124-git-svn-dcommit-auto-props.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,21 @@ test_expect_success 'check resulting svn repository' '
8181
)
8282
'
8383

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+
84101
test_done

0 commit comments

Comments
 (0)