Guilt v0.37-rc1
[guilt.git] / regression / t-025.sh
blob8c439fce3459c63848e967f568aefb035eb91e59
1 #!/bin/bash
3 # Test the new code
6 source "$REG_DIR/scaffold"
8 cmd setup_repo
10 function fixup_time_info
12 touch -a -m -t "$TOUCH_DATE" ".git/patches/master/$1"
15 for pname in file dir/file dir/subdir/file ; do
16 cmd guilt new "$pname"
17 cmd guilt pop
18 fixup_time_info "$pname"
19 cmd guilt push
21 cmd list_files
22 done
24 cmd guilt push --all
26 cmd guilt new append
27 cmd guilt pop
28 fixup_time_info append
29 cmd guilt push
31 cmd list_files
33 cmd guilt pop --all
35 cmd guilt new prepend
36 cmd guilt pop
37 fixup_time_info prepend
38 cmd guilt push
40 cmd list_files
42 shouldfail guilt new "white space"
44 cmd list_files
46 b()
48 printf "%b" "$1"
51 for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. \
52 abc/.. abc/ abc.lock a/b.lock/c `b 'cr\r'` `b 'ctrl-a\001'` \
53 `b 'formfeed\f'` `b 'del\177'` "tilde~" "caret^" "colon:" \
54 "questionmark?" "asterisk*" "open[bracket" "consecutive//slashes" \
55 "trailing-dot." "bad@{seq" "@" "backslash\\"
57 shouldfail guilt new "$pname"
59 cmd list_files
60 done
63 # Test the -f option
66 # modify the working dir file
67 cmd echo qwerty >> def
68 cmd git diff
70 # try to make a new patch, without -f
71 shouldfail guilt new uncommitted-changes
72 cmd git diff
73 cmd list_files
75 # give new -f, to force things
76 cmd guilt new -f uncommitted-changes
77 cmd git diff
78 cmd guilt pop
79 fixup_time_info uncommitted-changes
80 cmd guilt push
81 cmd list_files
83 # modify the working dir file (again)
84 cmd echo dvorak >> def
85 cmd git update-index def
86 cmd git diff
87 cmd git diff HEAD
89 # try to make a new patch, without -f
90 shouldfail guilt new uncommitted-changes2
91 cmd git diff
92 cmd git diff HEAD
93 cmd list_files
95 # give new -f, to force things
96 cmd guilt new -f uncommitted-changes2
97 cmd git diff
98 cmd git diff HEAD
99 cmd guilt pop
100 fixup_time_info uncommitted-changes2
101 cmd guilt push
102 cmd list_files