Git fork
1#!/bin/sh
2
3test_description='git svn dcommit CRLF'
4GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7. ./lib-git-svn.sh
8
9test_expect_success 'setup commit repository' '
10 svn_cmd mkdir -m "$test_description" "$svnrepo/dir" &&
11 git svn clone "$svnrepo" work &&
12 (
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
27 )
28'
29
30test_done