File tree 2 files changed +20
-7
lines changed
2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ auto_calculate_args() {
95
95
checkpoint_file=" $git_dir /review/checkpoints/${pr_branch// \/ /% } "
96
96
97
97
if [[ -z " $from_checkpoint " ]] && [[ -f " $checkpoint_file " ]]; then
98
- from_checkpoint=" $( cat " $checkpoint_file " | tail -n 1 ) "
98
+ from_checkpoint=" $( get_last_checkpoint ) "
99
99
fi
100
100
101
101
if [[ " $local_branch " == ' true' ]]; then
@@ -146,16 +146,20 @@ exec_reset_checkpoint() {
146
146
}
147
147
148
148
exec_save_checkpoint () {
149
- if ! has_changes; then
150
- info ' No changes to save.'
151
- exit 0
149
+ if has_changes; then
150
+ git status
151
+
152
+ git commit -m " Reviewed (from checkpoint $from_checkpoint )"
152
153
fi
153
154
154
- git status
155
+ new_checkpoint=" $( git rev-parse --verify HEAD) "
156
+ last_checkpoint=" $( get_last_checkpoint) "
155
157
156
- git commit -m " Reviewed (from checkpoint $from_checkpoint )"
158
+ if [[ " $new_checkpoint " == " $last_checkpoint " ]]; then
159
+ info ' No changes to save.'
160
+ exit 0
161
+ fi
157
162
158
- new_checkpoint=" $( git rev-parse --verify HEAD) "
159
163
mkdir -p " $( dirname " $checkpoint_file " ) "
160
164
echo " $new_checkpoint " >> " $checkpoint_file "
161
165
info " Saved checkpoint '$new_checkpoint ' to '$checkpoint_file '."
@@ -226,4 +230,12 @@ exec_update() {
226
230
exit 0
227
231
}
228
232
233
+ get_last_checkpoint () {
234
+ if ! [[ -f " $checkpoint_file " ]]; then
235
+ fail ' No checkpoint file.'
236
+ fi
237
+
238
+ cat " $checkpoint_file " | tail -n 1
239
+ }
240
+
229
241
main " $@ "
Original file line number Diff line number Diff line change 285
285
" cmake" ,
286
286
" cyclomatic" ,
287
287
" datefmt" ,
288
+ " descendency" ,
288
289
" dotfiles" ,
289
290
" dtype" ,
290
291
" eventhub" ,
You can’t perform that action at this time.
0 commit comments