restore: Implemented with rebase and reset. (Do not forget to reset manually in case...
[gitgitconfig.git] / tests / remoteadd-init-add-a-save-clone-init-add-a-restore.sh
blob8fd5914127fb3c7a68d249a926d0969fcbbcac6e
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 .
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 .
27 git commit -m 'Initial conf after clone.'
28 popd
29 gitgitconfig-restore first
31 if [[ "$(git remote)" == "$(echo there)" ]]; then
32 exit 0
33 else
34 exit 1