about summary refs log tree commit diff
path: root/third_party/git/t/t6026-merge-attr.sh
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-11-21T18·20+0100
committerVincent Ambo <mail@tazj.in>2020-11-21T18·45+0100
commitf4609b896fac842433bd495c166d5987852a6a73 (patch)
tree95511c465c54c4f5d27e5d39ce187e2a1dd82bd3 /third_party/git/t/t6026-merge-attr.sh
parent082c006c04343a78d87b6c6ab3608c25d6213c3f (diff)
merge(3p/git): Merge git subtree at v2.29.2 r/1890
This also bumps the stable nixpkgs to 20.09 as of 2020-11-21, because
there is some breakage in the git build related to the netrc
credentials helper which someone has taken care of in nixpkgs.

The stable channel is not used for anything other than git, so this
should be fine.

Change-Id: I3575a19dab09e1e9556cf8231d717de9890484fb
Diffstat (limited to 'third_party/git/t/t6026-merge-attr.sh')
-rwxr-xr-xthird_party/git/t/t6026-merge-attr.sh207
1 files changed, 0 insertions, 207 deletions
diff --git a/third_party/git/t/t6026-merge-attr.sh b/third_party/git/t/t6026-merge-attr.sh
deleted file mode 100755
index 8f9b48a4937b..000000000000
--- a/third_party/git/t/t6026-merge-attr.sh
+++ /dev/null
@@ -1,207 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2007 Junio C Hamano
-#
-
-test_description='per path merge controlled by merge attribute'
-
-. ./test-lib.sh
-
-test_expect_success setup '
-
-	for f in text binary union
-	do
-		echo Initial >$f && git add $f || return 1
-	done &&
-	test_tick &&
-	git commit -m Initial &&
-
-	git branch side &&
-	for f in text binary union
-	do
-		echo Master >>$f && git add $f || return 1
-	done &&
-	test_tick &&
-	git commit -m Master &&
-
-	git checkout side &&
-	for f in text binary union
-	do
-		echo Side >>$f && git add $f || return 1
-	done &&
-	test_tick &&
-	git commit -m Side &&
-
-	git tag anchor
-'
-
-test_expect_success merge '
-
-	{
-		echo "binary -merge"
-		echo "union merge=union"
-	} >.gitattributes &&
-
-	if git merge master
-	then
-		echo Gaah, should have conflicted
-		false
-	else
-		echo Ok, conflicted.
-	fi
-'
-
-test_expect_success 'check merge result in index' '
-
-	git ls-files -u | grep binary &&
-	git ls-files -u | grep text &&
-	! (git ls-files -u | grep union)
-
-'
-
-test_expect_success 'check merge result in working tree' '
-
-	git cat-file -p HEAD:binary >binary-orig &&
-	grep "<<<<<<<" text &&
-	cmp binary-orig binary &&
-	! grep "<<<<<<<" union &&
-	grep Master union &&
-	grep Side union
-
-'
-
-test_expect_success 'retry the merge with longer context' '
-	echo text conflict-marker-size=32 >>.gitattributes &&
-	git checkout -m text &&
-	sed -ne "/^\([<=>]\)\1\1\1*/{
-		s/ .*$//
-		p
-	}" >actual text &&
-	grep ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" actual &&
-	grep "================================" actual &&
-	grep "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" actual
-'
-
-cat >./custom-merge <<\EOF
-#!/bin/sh
-
-orig="$1" ours="$2" theirs="$3" exit="$4" path=$5
-(
-	echo "orig is $orig"
-	echo "ours is $ours"
-	echo "theirs is $theirs"
-	echo "path is $path"
-	echo "=== orig ==="
-	cat "$orig"
-	echo "=== ours ==="
-	cat "$ours"
-	echo "=== theirs ==="
-	cat "$theirs"
-) >"$ours+"
-cat "$ours+" >"$ours"
-rm -f "$ours+"
-exit "$exit"
-EOF
-chmod +x ./custom-merge
-
-test_expect_success 'custom merge backend' '
-
-	echo "* merge=union" >.gitattributes &&
-	echo "text merge=custom" >>.gitattributes &&
-
-	git reset --hard anchor &&
-	git config --replace-all \
-	merge.custom.driver "./custom-merge %O %A %B 0 %P" &&
-	git config --replace-all \
-	merge.custom.name "custom merge driver for testing" &&
-
-	git merge master &&
-
-	cmp binary union &&
-	sed -e 1,3d text >check-1 &&
-	o=$(git unpack-file master^:text) &&
-	a=$(git unpack-file side^:text) &&
-	b=$(git unpack-file master:text) &&
-	sh -c "./custom-merge $o $a $b 0 'text'" &&
-	sed -e 1,3d $a >check-2 &&
-	cmp check-1 check-2 &&
-	rm -f $o $a $b
-'
-
-test_expect_success 'custom merge backend' '
-
-	git reset --hard anchor &&
-	git config --replace-all \
-	merge.custom.driver "./custom-merge %O %A %B 1 %P" &&
-	git config --replace-all \
-	merge.custom.name "custom merge driver for testing" &&
-
-	if git merge master
-	then
-		echo "Eh? should have conflicted"
-		false
-	else
-		echo "Ok, conflicted"
-	fi &&
-
-	cmp binary union &&
-	sed -e 1,3d text >check-1 &&
-	o=$(git unpack-file master^:text) &&
-	a=$(git unpack-file anchor:text) &&
-	b=$(git unpack-file master:text) &&
-	sh -c "./custom-merge $o $a $b 0 'text'" &&
-	sed -e 1,3d $a >check-2 &&
-	cmp check-1 check-2 &&
-	sed -e 1,3d -e 4q $a >check-3 &&
-	echo "path is text" >expect &&
-	cmp expect check-3 &&
-	rm -f $o $a $b
-'
-
-test_expect_success 'up-to-date merge without common ancestor' '
-	test_create_repo repo1 &&
-	test_create_repo repo2 &&
-	test_tick &&
-	(
-		cd repo1 &&
-		>a &&
-		git add a &&
-		git commit -m initial
-	) &&
-	test_tick &&
-	(
-		cd repo2 &&
-		git commit --allow-empty -m initial
-	) &&
-	test_tick &&
-	(
-		cd repo1 &&
-		git fetch ../repo2 master &&
-		git merge --allow-unrelated-histories FETCH_HEAD
-	)
-'
-
-test_expect_success 'custom merge does not lock index' '
-	git reset --hard anchor &&
-	write_script sleep-an-hour.sh <<-\EOF &&
-		sleep 3600 &
-		echo $! >sleep.pid
-	EOF
-
-	test_write_lines >.gitattributes \
-		"* merge=ours" "text merge=sleep-an-hour" &&
-	test_config merge.ours.driver true &&
-	test_config merge.sleep-an-hour.driver ./sleep-an-hour.sh &&
-
-	# We are testing that the custom merge driver does not block
-	# index.lock on Windows due to an inherited file handle.
-	# To ensure that the backgrounded process ran sufficiently
-	# long (and has been started in the first place), we do not
-	# ignore the result of the kill command.
-	# By packaging the command in test_when_finished, we get both
-	# the correctness check and the clean-up.
-	test_when_finished "kill \$(cat sleep.pid)" &&
-	git merge master
-'
-
-test_done