merge(3p/git): Merge git subtree at v2.29.2

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
This commit is contained in:
Vincent Ambo 2020-11-21 19:20:35 +01:00
parent 082c006c04
commit f4609b896f
1485 changed files with 241535 additions and 109418 deletions

View file

@ -3,80 +3,55 @@
# Copyright (c) 2005 Junio C Hamano
#
test_description='git apply boundary tests
test_description='git apply boundary tests'
'
. ./test-lib.sh
L="c d e f g h i j k l m n o p q r s t u v w x"
test_expect_success setup '
for i in b '"$L"' y
do
echo $i
done >victim &&
test_write_lines b $L y >victim &&
cat victim >original &&
git update-index --add victim &&
# add to the head
for i in a b '"$L"' y
do
echo $i
done >victim &&
test_write_lines a b $L y >victim &&
cat victim >add-a-expect &&
git diff victim >add-a-patch.with &&
git diff --unified=0 >add-a-patch.without &&
# insert at line two
for i in b a '"$L"' y
do
echo $i
done >victim &&
test_write_lines b a $L y >victim &&
cat victim >insert-a-expect &&
git diff victim >insert-a-patch.with &&
git diff --unified=0 >insert-a-patch.without &&
# modify at the head
for i in a '"$L"' y
do
echo $i
done >victim &&
test_write_lines a $L y >victim &&
cat victim >mod-a-expect &&
git diff victim >mod-a-patch.with &&
git diff --unified=0 >mod-a-patch.without &&
# remove from the head
for i in '"$L"' y
do
echo $i
done >victim &&
test_write_lines $L y >victim &&
cat victim >del-a-expect &&
git diff victim >del-a-patch.with &&
git diff --unified=0 >del-a-patch.without &&
# add to the tail
for i in b '"$L"' y z
do
echo $i
done >victim &&
test_write_lines b $L y z >victim &&
cat victim >add-z-expect &&
git diff victim >add-z-patch.with &&
git diff --unified=0 >add-z-patch.without &&
# modify at the tail
for i in b '"$L"' z
do
echo $i
done >victim &&
test_write_lines b $L z >victim &&
cat victim >mod-z-expect &&
git diff victim >mod-z-patch.with &&
git diff --unified=0 >mod-z-patch.without &&
# remove from the tail
for i in b '"$L"'
do
echo $i
done >victim &&
test_write_lines b $L >victim &&
cat victim >del-z-expect &&
git diff victim >del-z-patch.with &&
git diff --unified=0 >del-z-patch.without
@ -88,15 +63,15 @@ for with in with without
do
case "$with" in
with) u= ;;
without) u='--unidiff-zero ' ;;
without) u=--unidiff-zero ;;
esac
for kind in add-a add-z insert-a mod-a mod-z del-a del-z
do
test_expect_success "apply $kind-patch $with context" '
cat original >victim &&
git update-index victim &&
git apply --index '"$u$kind-patch.$with"' &&
test_cmp '"$kind"'-expect victim
git apply --index $u "$kind-patch.$with" &&
test_cmp "$kind-expect" victim
'
done
done
@ -110,13 +85,12 @@ do
test_expect_success "apply non-git $kind-patch without context" '
cat original >victim &&
git update-index victim &&
git apply --unidiff-zero --index '"$kind-ng.without"' &&
test_cmp '"$kind"'-expect victim
git apply --unidiff-zero --index "$kind-ng.without" &&
test_cmp "$kind-expect" victim
'
done
test_expect_success 'two lines' '
>file &&
git add file &&
echo aaa >file &&
@ -125,11 +99,10 @@ test_expect_success 'two lines' '
echo bbb >file &&
git add file &&
test_must_fail git apply --check patch
'
test_expect_success 'apply patch with 3 context lines matching at end' '
{ echo a; echo b; echo c; echo d; } >file &&
test_write_lines a b c d >file &&
git add file &&
echo e >>file &&
git diff >patch &&