Guilt v0.37-rc1
[guilt.git] / regression / t-033.sh
blobae2291413473407dd51ea3f6d7a2ab50390ab3c6
1 #!/bin/bash
3 # Test the graph code
6 function fixup_time_info
8 cmd guilt pop
9 touch -a -m -t "$TOUCH_DATE" ".git/patches/a,graph/$1"
10 cmd guilt push
13 source "$REG_DIR/scaffold"
15 cmd setup_repo
17 # Check that "guilt graph" gives a proper "No patch applied" error
18 # message when no patches are applied. (An older version of guilt
19 # used to enter an endless loop in this situation.)
20 shouldfail guilt graph
22 echo "%% Testing branch a,graph"
23 cmd git checkout -b a,graph master
25 cmd guilt init
27 cmd guilt new a.patch
29 fixup_time_info a.patch
30 cmd guilt graph
32 cmd echo a >> file.txt
33 cmd git add file.txt
34 cmd guilt refresh
35 fixup_time_info a.patch
36 cmd guilt graph
38 echo "%% Adding an unrelated file in a new patch. No deps."
39 cmd guilt new b.patch
40 cmd echo b >> file2.txt
41 cmd git add file2.txt
42 cmd guilt refresh
43 fixup_time_info b.patch
44 cmd guilt graph
46 echo "%% Changing a file already changed in the first patch adds a dependency."
47 cmd guilt new c.patch
48 cmd echo c >> file.txt
49 cmd git add file.txt
50 cmd guilt refresh
51 fixup_time_info c.patch
52 cmd guilt graph
54 # A patch name that contains funky characters, including unbalanced
55 # quotes.
56 cmd guilt new "a-\"better&quicker'-patch.patch"
57 cmd echo d >> file.txt
58 cmd git add file.txt
59 cmd guilt refresh
60 fixup_time_info "a-\"better&quicker'-patch.patch"
61 cmd guilt graph
63 echo "%% The same graph, but excluding deps introduced by file.txt."
64 cmd guilt graph -x file.txt