regression: test 010: test the init code
[guilt.git] / regression / t-010.sh
blob6b1501ac9b579219ef55dd0baab643be4f4b4281
1 #!/bin/bash
3 # Test the init code
6 source $REG_DIR/scaffold
8 function relative_git_dir_path
10 sed -e "s,GIT_DIR=$PWD/,GIT_DIR=,"
13 begin "setup_git_repo"
14 setup_git_repo
16 begin "guilt-init"
17 guilt-init 2>&1
19 begin "list_files"
20 list_files
22 begin "guilt-init (should fail)"
23 shouldfail guilt-init 2>&1 | relative_git_dir_path
25 begin "list_files"
26 list_files
28 begin "git-branch other"
29 git-branch other
31 begin "git-checkout other"
32 git-checkout other 2> /dev/null
34 begin "guilt-init (other branch)"
35 guilt-init 2>&1
37 begin "list_files"
38 list_files
40 begin "guilt-init (other branch, should fail)"
41 shouldfail guilt-init 2>&1 | relative_git_dir_path
43 begin "list_files"
44 list_files