]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9162-git-svn-dcommit-interactive.sh
Merge branch 'jk/clone-allow-bare-and-o-together'
[thirdparty/git.git] / t / t9162-git-svn-dcommit-interactive.sh
CommitLineData
afd7f1eb
FH
1#!/bin/sh
2#
3# Copyright (c) 2011 Frédéric Heitzmann
4
5test_description='git svn dcommit --interactive series'
7a98d9ab 6
afd7f1eb
FH
7. ./lib-git-svn.sh
8
9test_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" &&
14 git svn dcommit
15 '
16
17test_expect_success 'answers: y [\n] yes' '
18 (
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" &&
22 ( echo "y
23
24y" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
25 test $(git rev-parse HEAD) = $(git rev-parse remotes/git-svn)
26 )
27 '
28
29test_expect_success 'answers: yes yes no' '
30 (
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" &&
34 ( echo "yes
35yes
36no" | 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
39 )
40 '
41
42test_expect_success 'answers: yes quit' '
43 (
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" &&
47 ( echo "yes
48quit" | 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
51 )
52 '
53
54test_expect_success 'answers: all' '
55 (
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
62 )
63 '
64
65test_done