git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
ab404a100f950ebd6dfb8fec734f225bbb5236f1 blob 1182 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
#!/bin/sh
#
# Copyright 2020 Google LLC
#

test_description='git apply of i-t-a file'

. ./test-lib.sh

test_expect_success setup '
	test_write_lines 1 2 3 4 5 >blueprint &&

	cat blueprint >test-file &&
	git add -N test-file &&
	git diff >creation-patch &&
	grep "new file mode 100644" creation-patch
'

test_expect_success 'apply creation patch to ita path (--cached)' '
	git rm -f test-file &&
	cat blueprint >test-file &&
	git add -N test-file &&

	git apply --cached creation-patch &&
	git cat-file blob :test-file >actual &&
	test_cmp blueprint actual
'

test_expect_success 'apply creation patch to ita path (--index)' '
	git rm -f test-file &&
	cat blueprint >test-file &&
	git add -N test-file &&
	rm -f test-file &&

	# NEEDSWORK: this should fail as test-file does not
	# agree between index and the working tree, no?????
	git apply --index creation-patch &&
	git cat-file blob :test-file >actual &&
	test_cmp blueprint actual &&
	test_cmp blueprint test-file
'

test_expect_success 'apply creation patch to ita path (--index)' '
	git rm -f test-file &&
	cat blueprint >test-file &&
	git add -N test-file &&

	test_must_fail git apply --index creation-patch
'

test_done
debug log:

solving e9f3749e65 ...
found e9f3749e65 in https://public-inbox.org/git/xmqqeeomq8dr.fsf@gitster.c.googlers.com/

applying [1/1] https://public-inbox.org/git/xmqqeeomq8dr.fsf@gitster.c.googlers.com/
diff --git a/t/t4140-apply-ita.sh b/t/t4140-apply-ita.sh
new file mode 100755
index 0000000000..e9f3749e65

Checking patch t/t4140-apply-ita.sh...
Applied patch t/t4140-apply-ita.sh cleanly.

index at:
100755 ab404a100f950ebd6dfb8fec734f225bbb5236f1	t/t4140-apply-ita.sh

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).