forked from vitaly/guilt
-
Notifications
You must be signed in to change notification settings - Fork 1
/
t-025.sh
executable file
·92 lines (70 loc) · 1.5 KB
/
t-025.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
#
# Test the new code
#
source $REG_DIR/scaffold
cmd setup_repo
function fixup_time_info
{
touch -d "$GIT_COMMITTER_DATE" ".git/patches/master/$1"
}
for pname in file dir/file dir/subdir/file ; do
cmd guilt-new "$pname"
cmd guilt-pop
fixup_time_info "$pname"
cmd guilt-push
cmd list_files
done
cmd guilt-push --all
cmd guilt-new append
cmd guilt-pop
fixup_time_info append
cmd guilt-push
cmd list_files
cmd guilt-pop --all
cmd guilt-new prepend
cmd guilt-pop
fixup_time_info prepend
cmd guilt-push
cmd list_files
shouldfail guilt-new "white space"
cmd list_files
for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. abc/.. abc/ ; do
shouldfail guilt-new "$pname" 2>&1
cmd list_files
done
#
# Test the -f option
#
# modify the working dir file
cmd echo qwerty >> def
cmd git diff
# try to make a new patch, without -f
shouldfail guilt new uncommitted-changes
cmd git diff
cmd list_files
# give new -f, to force things
cmd guilt new -f uncommitted-changes
cmd git diff
cmd guilt pop
fixup_time_info uncommitted-changes
cmd guilt push
cmd list_files
# modify the working dir file (again)
cmd echo dvorak >> def
cmd git update-index def
cmd git diff
cmd git diff HEAD
# try to make a new patch, without -f
shouldfail guilt new uncommitted-changes2
cmd git diff
cmd git diff HEAD
cmd list_files
# give new -f, to force things
cmd guilt new -f uncommitted-changes2
cmd git diff
cmd git diff HEAD
cmd guilt pop
fixup_time_info uncommitted-changes2
cmd guilt push
cmd list_files