3 # Copyright (c) 2011 Frédéric Heitzmann
5 test_description
='git svn dcommit --interactive series'
9 test_expect_success
'initialize repo' '
10 svn_cmd mkdir -m"mkdir test-interactive" "$svnrepo/test-interactive" &&
11 git svn clone "$svnrepo/test-interactive" test-interactive &&
12 cd test-interactive &&
13 touch foo && git add foo && git commit -m"foo: first commit" &&
17 test_expect_success
'answers: y [\n] yes' '
19 echo "change #1" >> foo && git commit -a -m"change #1" &&
20 echo "change #2" >> foo && git commit -a -m"change #2" &&
21 echo "change #3" >> foo && git commit -a -m"change #3" &&
24 y" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
25 test $(git rev-parse HEAD) = $(git rev-parse remotes/git-svn)
29 test_expect_success
'answers: yes yes no' '
31 echo "change #1" >> foo && git commit -a -m"change #1" &&
32 echo "change #2" >> foo && git commit -a -m"change #2" &&
33 echo "change #3" >> foo && git commit -a -m"change #3" &&
36 no" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
37 test $(git rev-parse HEAD^^^) = $(git rev-parse remotes/git-svn) &&
38 git reset --hard remotes/git-svn
42 test_expect_success
'answers: yes quit' '
44 echo "change #1" >> foo && git commit -a -m"change #1" &&
45 echo "change #2" >> foo && git commit -a -m"change #2" &&
46 echo "change #3" >> foo && git commit -a -m"change #3" &&
48 quit" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
49 test $(git rev-parse HEAD^^^) = $(git rev-parse remotes/git-svn) &&
50 git reset --hard remotes/git-svn
54 test_expect_success
'answers: all' '
56 echo "change #1" >> foo && git commit -a -m"change #1" &&
57 echo "change #2" >> foo && git commit -a -m"change #2" &&
58 echo "change #3" >> foo && git commit -a -m"change #3" &&
59 ( echo "all" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
60 test $(git rev-parse HEAD) = $(git rev-parse remotes/git-svn) &&
61 git reset --hard remotes/git-svn