1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-20 21:36:13 +02:00
git/t/t9169-git-svn-dcommit-crlf.sh
Johannes Schindelin a881baa2c3 t9[0-4]*: adjust the references to the default branch name "main"
This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t9[0-4]*.sh)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-19 15:44:18 -08:00

31 lines
757 B
Bash
Executable File

#!/bin/sh
test_description='git svn dcommit CRLF'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./lib-git-svn.sh
test_expect_success 'setup commit repository' '
svn_cmd mkdir -m "$test_description" "$svnrepo/dir" &&
git svn clone "$svnrepo" work &&
(
cd work &&
echo foo >>foo &&
git update-index --add foo &&
printf "a\\r\\n\\r\\nb\\r\\nc\\r\\n" >cmt &&
p=$(git rev-parse HEAD) &&
t=$(git write-tree) &&
cmt=$(git commit-tree -p $p $t <cmt) &&
git update-ref refs/heads/main $cmt &&
git cat-file commit HEAD | tail -n4 >out &&
test_cmp cmt out &&
git svn dcommit &&
printf "a\\n\\nb\\nc\\n" >exp &&
git cat-file commit HEAD | sed -ne 6,9p >out &&
test_cmp exp out
)
'
test_done