git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
3259bd59ebc1e35064dfff2c4f20a31964aef983 blob 2440 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
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
 
#!/bin/sh

test_description='cherry picking and reverting a merge

		b---c
	       /   /
	initial---a

'

. ./test-lib.sh

test_expect_success setup '

	>A &&
	>B &&
	git add A B &&
	git commit -m "Initial" &&
	git tag initial &&
	git branch side &&
	echo new line >A &&
	git commit -m "add line to A" A &&
	git tag a &&
	git checkout side &&
	echo new line >B &&
	git commit -m "add line to B" B &&
	git tag b &&
	git checkout master &&
	git merge side &&
	git tag c

'

test_expect_success 'cherry-pick -m complains of bogus numbers' '
	# expect 129 here to distinguish between cases where
	# there was nothing to cherry-pick
	test_expect_code 129 git cherry-pick -m &&
	test_expect_code 129 git cherry-pick -m foo b &&
	test_expect_code 129 git cherry-pick -m -1 b &&
	test_expect_code 129 git cherry-pick -m 0 b
'

test_expect_success 'cherry-pick explicit first parent of a non-merge' '

	git reset --hard &&
	git checkout a^0 &&
	git cherry-pick -m 1 b &&
	git diff --exit-code c --

'

test_expect_success 'cherry pick a merge without -m should fail' '

	git reset --hard &&
	git checkout a^0 &&
	test_must_fail git cherry-pick c &&
	git diff --exit-code a --

'

test_expect_success 'cherry pick a merge (1)' '

	git reset --hard &&
	git checkout a^0 &&
	git cherry-pick -m 1 c &&
	git diff --exit-code c

'

test_expect_success 'cherry pick a merge (2)' '

	git reset --hard &&
	git checkout b^0 &&
	git cherry-pick -m 2 c &&
	git diff --exit-code c

'

test_expect_success 'cherry pick a merge relative to nonexistent parent should fail' '

	git reset --hard &&
	git checkout b^0 &&
	test_must_fail git cherry-pick -m 3 c

'

test_expect_success 'revert explicit first parent of a non-merge' '

	git reset --hard &&
	git checkout c^0 &&
	git revert -m 1 b &&
	git diff --exit-code a

'

test_expect_success 'revert a merge without -m should fail' '

	git reset --hard &&
	git checkout c^0 &&
	test_must_fail git revert c &&
	git diff --exit-code c

'

test_expect_success 'revert a merge (1)' '

	git reset --hard &&
	git checkout c^0 &&
	git revert -m 1 c &&
	git diff --exit-code a --

'

test_expect_success 'revert a merge (2)' '

	git reset --hard &&
	git checkout c^0 &&
	git revert -m 2 c &&
	git diff --exit-code b --

'

test_expect_success 'revert a merge relative to nonexistent parent should fail' '

	git reset --hard &&
	git checkout c^0 &&
	test_must_fail git revert -m 3 c &&
	git diff --exit-code c

'

test_done
debug log:

solving 3259bd5 ...
found 3259bd5 in https://public-inbox.org/git/xmqqr2e1mmuu.fsf@gitster-ct.c.googlers.com/ ||
	https://public-inbox.org/git/ccfe8ae38301b6ee1b0924fbf00eb5d20242ea5d.1544764226.git.sorganov@gmail.com/
found b1602718f8 in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100755 b1602718f85468d17faa1cc0d7ae8854ac2f5407	t/t3502-cherry-pick-merge.sh

applying [1/2] https://public-inbox.org/git/xmqqr2e1mmuu.fsf@gitster-ct.c.googlers.com/
diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh
index b1602718f8..3259bd59eb 100755

Checking patch t/t3502-cherry-pick-merge.sh...
Applied patch t/t3502-cherry-pick-merge.sh cleanly.

skipping https://public-inbox.org/git/ccfe8ae38301b6ee1b0924fbf00eb5d20242ea5d.1544764226.git.sorganov@gmail.com/ for 3259bd59eb
index at:
100755 3259bd59ebc1e35064dfff2c4f20a31964aef983	t/t3502-cherry-pick-merge.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).