File: t3400-pick.sh

package info (click to toggle)
stgit 0.19-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,748 kB
  • sloc: python: 10,558; sh: 5,739; lisp: 2,678; makefile: 142; perl: 42
file content (59 lines) | stat: -rwxr-xr-x 1,505 bytes parent folder | download | duplicates (5)
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
#!/bin/sh
test_description='Test the pick command'

. ./test-lib.sh

test_expect_success \
	'Initialize the StGIT repository' \
	'
	stg init &&
	stg new A -m "a" && echo A > a && stg add a && stg refresh &&
	stg new B -m "b" && echo B > b && stg add b && stg refresh &&
	stg branch --clone foo &&
	stg new C -m "c" && echo C > c && stg add c && stg refresh &&
	stg new D-foo -m "d" && echo D > d && stg add d && stg refresh &&
	stg branch master
	'

test_expect_success \
	'Pick remote patch' \
	'
	stg pick foo:C &&
	test "$(echo $(stg series --applied --noprefix))" = "A B C"
	'

test_expect_success \
	'Pick --unapplied remote patch' \
	'
	stg pick --unapplied --ref-branch foo --name D D-foo &&
	test "$(echo $(stg series --applied --noprefix))" = "A B C" &&
	test "$(echo $(stg series --unapplied --noprefix))" = "D"
	'

test_expect_success \
	'Pick local unapplied patch' \
	'
	stg pick D &&
	test "$(echo $(stg series --applied --noprefix))" = "A B C D-0" &&
	test "$(echo $(stg series --unapplied --noprefix))" = "D"
	'

test_expect_success \
	'Pick --fold --revert local patch' \
	'
	stg pick --fold --revert D &&
	stg refresh && stg clean &&
	test "$(echo $(stg series --applied --noprefix))" = "A B C" &&
	test "$(echo $(stg series --unapplied --noprefix))" = "D"
	'

test_expect_success \
	'Pick --fold without applied patches' \
	'
	stg pop --all &&
	stg pick --fold D &&
	test "$(echo $(stg series --unapplied --noprefix))" = "A B C D" &&
	test "$(echo $(stg status))" = "A d"
	'

test_done