File: t9162-git-svn-dcommit-interactive.sh

package info (click to toggle)
cgit 1.1%2Bgit2.10.2-3~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 31,812 kB
  • sloc: ansic: 179,975; sh: 150,940; perl: 29,466; tcl: 21,429; python: 7,116; makefile: 3,424; lisp: 1,786; php: 120; asm: 98; csh: 45
file content (64 lines) | stat: -rwxr-xr-x 2,015 bytes parent folder | download | duplicates (16)
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
#!/bin/sh
#
# Copyright (c) 2011 Frédéric Heitzmann

test_description='git svn dcommit --interactive series'
. ./lib-git-svn.sh

test_expect_success 'initialize repo' '
	svn_cmd mkdir -m"mkdir test-interactive" "$svnrepo/test-interactive" &&
	git svn clone "$svnrepo/test-interactive" test-interactive &&
	cd test-interactive &&
	touch foo && git add foo && git commit -m"foo: first commit" &&
	git svn dcommit
	'

test_expect_success 'answers: y [\n] yes' '
	(
		echo "change #1" >> foo && git commit -a -m"change #1" &&
		echo "change #2" >> foo && git commit -a -m"change #2" &&
		echo "change #3" >> foo && git commit -a -m"change #3" &&
		( echo "y

y" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
		test $(git rev-parse HEAD) = $(git rev-parse remotes/git-svn)
	)
	'

test_expect_success 'answers: yes yes no' '
	(
		echo "change #1" >> foo && git commit -a -m"change #1" &&
		echo "change #2" >> foo && git commit -a -m"change #2" &&
		echo "change #3" >> foo && git commit -a -m"change #3" &&
		( echo "yes
yes
no" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
		test $(git rev-parse HEAD^^^) = $(git rev-parse remotes/git-svn) &&
		git reset --hard remotes/git-svn
	)
	'

test_expect_success 'answers: yes quit' '
	(
		echo "change #1" >> foo && git commit -a -m"change #1" &&
		echo "change #2" >> foo && git commit -a -m"change #2" &&
		echo "change #3" >> foo && git commit -a -m"change #3" &&
		( echo "yes
quit" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
		test $(git rev-parse HEAD^^^) = $(git rev-parse remotes/git-svn) &&
		git reset --hard remotes/git-svn
	)
	'

test_expect_success 'answers: all' '
	(
		echo "change #1" >> foo && git commit -a -m"change #1" &&
		echo "change #2" >> foo && git commit -a -m"change #2" &&
		echo "change #3" >> foo && git commit -a -m"change #3" &&
		( echo "all" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
		test $(git rev-parse HEAD) = $(git rev-parse remotes/git-svn) &&
		git reset --hard remotes/git-svn
	)
	'

test_done