mugit/testscript/cli-repo-set-head.txtar (view raw)
Oleksandr Smirnov
Oleksandr Smirnov
olexsmir@gmail.com test: add missing tests (#5)..., 2 months ago
olexsmir@gmail.com test: add missing tests (#5)..., 2 months ago
| 1 | # set head: sets default branch |
| 2 | |
| 3 | git init local |
| 4 | cp file.txt local/file.txt |
| 5 | git -C local add file.txt |
| 6 | git -C local commit -m 'init master' |
| 7 | |
| 8 | git -C local switch -c develop |
| 9 | cp develop.txt local/develop.txt |
| 10 | git -C local add develop.txt |
| 11 | git -C local commit -m 'init develop' |
| 12 | |
| 13 | |
| 14 | mugit repo new heady |
| 15 | git -C local push file://$REPOS/heady.git master |
| 16 | git -C local push file://$REPOS/heady.git develop |
| 17 | |
| 18 | |
| 19 | exec cat $REPOS/heady.git/HEAD |
| 20 | stdout 'ref: refs/heads/master' |
| 21 | |
| 22 | # change head |
| 23 | mugit repo set-head heady develop |
| 24 | stderr 'changed repo head repo=heady.git branch=develop' # fix output |
| 25 | |
| 26 | exec cat $REPOS/heady.git/HEAD |
| 27 | stdout 'ref: refs/heads/develop' |
| 28 | |
| 29 | # go back to master |
| 30 | mugit repo set-head heady.git master |
| 31 | stderr 'changed repo head repo=heady.git branch=master' # fix output |
| 32 | |
| 33 | exec cat $REPOS/heady.git/HEAD |
| 34 | stdout 'ref: refs/heads/master' |
| 35 | |
| 36 | |
| 37 | -- file.txt -- |
| 38 | initial content |
| 39 | |
| 40 | -- develop.txt -- |
| 41 | develop content |