File: t1203-push-conflict.sh

package info (click to toggle)
stgit 0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,752 kB
  • sloc: python: 10,558; sh: 5,739; lisp: 2,678; makefile: 142; perl: 42
file content (70 lines) | stat: -rwxr-xr-x 1,143 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
#
# Copyright (c) 2006 David Kågedal
#

test_description='Exercise push conflicts.

Test that the index has no modifications after a push with conflicts.
'

. ./test-lib.sh

test_expect_success \
	'Initialize the StGIT repository' \
	'stg init
'

test_expect_success \
	'Create the first patch' \
	'
	stg new foo -m foo &&
	echo foo > test &&
	echo fie > test2 &&
	stg add test test2 &&
	stg refresh &&
        stg pop
	'

test_expect_success \
	'Create the second patch' \
	'
	stg new bar -m bar &&
	echo bar > test &&
	stg add test &&
	stg refresh
	'

test_expect_success \
	'Push the first patch with conflict' \
	'
	conflict stg push foo
	'

test_expect_success \
	'Show the, now empty, first patch' \
	'
	! stg show foo | grep -q -e "^diff "
	'

test_expect_success \
	'Check that the index has the non-conflict updates' \
	'
	git diff --cached --stat | grep -q -e "^ test2 | *1 "
	'

test_expect_success \
	'Check that pop will fail while there are unmerged conflicts' \
	'
	command_error stg pop
	'

test_expect_success \
	'Resolve the conflict' \
	'
	echo resolved > test &&
	stg resolved test &&
	stg refresh
	'

test_done