tests: print the actions to see what is being done (and what has failed precisely).
[gitgitconfig.git] / tests / remoteadd-init-add-save-clone-init-add-restore.sh
blob0b2ced8c8b4320b3edc290cd3369d96a81126506
1 #!/bin/bash -ex
3 mkdir A
4 cd A
6 git init
7 echo a > a
8 git add a
9 git commit -m 'A.'
10 git remote add there git://example.com/a.git
11 gitgitconfig-init
12 pushd .git
13 git add config
14 git commit -m '"there" remote added.'
15 popd
16 gitgitconfig-save
18 cd ..
20 git clone -o first A B
21 cd B
23 gitgitconfig-init
24 # Unfortunately, we have to add the inital state of the config manually.
25 pushd .git
26 git add config
27 git commit -m 'Initial conf after clone.'
28 popd
29 gitgitconfig-restore first
31 cd .git
33 if [[ "$(git remote)" == "$(echo there)" ]]; then
34 exit 0
35 else
36 exit 1