File: t2200-rebase.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 (46 lines) | stat: -rwxr-xr-x 798 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
#!/bin/sh
#
# Copyright (c) 2007 Yann Dirson
#

test_description='Test the "rebase" command.'

. ./test-lib.sh

test_expect_success \
	'Setup a multi-commit branch and fork an stgit stack' \
	'
	echo foo > file1 &&
	stg add file1 &&
	git commit -m a &&
	echo foo > file2 &&
	stg add file2 &&
	git commit -m b &&

	stg branch --create stack &&
	stg new p -m . &&
	echo bar >> file1 &&
	stg refresh
	'

test_expect_success \
	'Rebase to previous commit' \
	'
	stg rebase master~1 &&
	test `stg id stack:{base}` = `git rev-parse master~1` &&
	test `stg series --applied -c` = 1
	'

test_expect_success \
	'Attempt rebase to non-existing commit' \
	'
	command_error stg rebase not-a-ref
	'

test_expect_success \
	'Check patches were re-applied' \
	'
	test $(stg series --applied -c) = 1
	'

test_done