[PATCH] Add "Date" field while creating patches from commits
[guilt.git] / regression / t-035.sh
blobc347e470d1eafaa318e05a0b7631e74100f75ad2
1 #!/bin/bash
3 # Test the fold code
6 source "$REG_DIR/scaffold"
8 cmd setup_repo
10 function fixup_time_info
12 cmd guilt pop
13 touch -a -m -t "$TOUCH_DATE" ".git/patches/master/$1"
14 cmd guilt push
17 function empty_patch
19 cmd guilt new "empty$1"
20 fixup_time_info "empty$1"
23 function nonempty_patch
25 if [ "$1" = -2 ]; then
26 msg="Another commit message."
27 else
28 msg="A commit message."
31 cmd guilt new -f -s -m "$msg" "nonempty$1"
32 fixup_time_info "nonempty$1"
35 for using_diffstat in true false; do
36 cmd git config guilt.diffstat $using_diffstat
37 for patcha in empty nonempty; do
38 for patchb in empty nonempty; do
40 if [ $patcha = $patchb ]; then
41 suffixa=-1
42 suffixb=-2
43 else
44 suffixa=
45 suffixb=
48 echo "%% $patcha + $patchb (diffstat=$using_diffstat)"
49 ${patcha}_patch $suffixa
50 ${patchb}_patch $suffixb
51 cmd guilt pop
52 cmd guilt fold $patchb$suffixb
53 fixup_time_info $patcha$suffixa
54 cmd list_files
55 cmd guilt pop
56 cmd guilt delete -f $patcha$suffixa
57 cmd list_files
59 done
60 done
61 done