init: remove git_init_db_config() while fixing leaks
[git/debian.git] / t / t9169-git-svn-dcommit-crlf.sh
blob7080b5d24f03d208fc265e030323972ad2babdf5
1 #!/bin/sh
3 test_description='git svn dcommit CRLF'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7 . ./lib-git-svn.sh
9 test_expect_success 'setup commit repository' '
10 svn_cmd mkdir -m "$test_description" "$svnrepo/dir" &&
11 git svn clone "$svnrepo" work &&
13 cd work &&
14 echo foo >>foo &&
15 git update-index --add foo &&
16 printf "a\\r\\n\\r\\nb\\r\\nc\\r\\n" >cmt &&
17 p=$(git rev-parse HEAD) &&
18 t=$(git write-tree) &&
19 cmt=$(git commit-tree -p $p $t <cmt) &&
20 git update-ref refs/heads/main $cmt &&
21 git cat-file commit HEAD | tail -n4 >out &&
22 test_cmp cmt out &&
23 git svn dcommit &&
24 printf "a\\n\\nb\\nc\\n" >exp &&
25 git cat-file commit HEAD | sed -ne 6,9p >out &&
26 test_cmp exp out
30 test_done