3 # Copyright (c) 2008 Brad King
5 test_description='git-svn dcommit honors auto-props'
9 generate_auto_props() {
14 *.sh = svn:mime-type=application/x-shellscript; svn:eol-style=LF
15 *.txt = svn:mime-type=text/plain; svn:eol-style = native
19 test_expect_success 'initialize git-svn' '
24 svn import -m "import for git-svn" . "$svnrepo"
27 git-svn init "$svnrepo"
31 test_expect_success 'enable auto-props config' '
34 generate_auto_props yes >user/config
37 test_expect_success 'add files matching auto-props' '
39 echo "#!$SHELL_PATH" >exec1.sh &&
41 echo "hello" >hello.txt &&
43 git add exec1.sh hello.txt bar &&
44 git commit -m "files for enabled auto-props" &&
45 git svn dcommit --config-dir=user
48 test_expect_success 'disable auto-props config' '
50 generate_auto_props no >user/config
53 test_expect_success 'add files matching disabled auto-props' '
55 echo "#$SHELL_PATH" >exec2.sh &&
57 echo "world" >world.txt &&
59 git add exec2.sh world.txt zot &&
60 git commit -m "files for disabled auto-props" &&
61 git svn dcommit --config-dir=user
64 test_expect_success 'check resulting svn repository' '
70 # Check properties from first commit.
71 test "x$(svn propget svn:executable exec1.sh)" = "x*" &&
72 test "x$(svn propget svn:mime-type exec1.sh)" = \
73 "xapplication/x-shellscript" &&
74 test "x$(svn propget svn:mime-type hello.txt)" = "xtext/plain" &&
75 test "x$(svn propget svn:eol-style hello.txt)" = "xnative" &&
76 test "x$(svn propget svn:mime-type bar)" = "x" &&
78 # Check properties from second commit.
79 test "x$(svn propget svn:executable exec2.sh)" = "x*" &&
80 test "x$(svn propget svn:mime-type exec2.sh)" = "x" &&
81 test "x$(svn propget svn:mime-type world.txt)" = "x" &&
82 test "x$(svn propget svn:eol-style world.txt)" = "x" &&
83 test "x$(svn propget svn:mime-type zot)" = "x"