diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-09-01 00:31:42 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-09-01 00:31:42 +0300 |
commit | 3525f1dbc18ae36ca9c671e807d6aac2ac432600 (patch) | |
tree | d859e5176e42a3c92eb3160b4ca9e29700dce35b | |
parent | 967bfc589421774886f006265bf7c78717274ed3 (diff) | |
parent | a9b5955e07793ceadaad05315c1599226d01292f (diff) |
Merge branch 'ob/sequencer-empty-hint-fix'
The use of API for consistency between two calls to
require_clean_work_tree() from the sequencer code has been cleaned
up.
* ob/sequencer-empty-hint-fix:
sequencer: rectify empty hint in call of require_clean_work_tree()
-rw-r--r-- | sequencer.c | 2 | ||||
-rw-r--r-- | wt-status.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c index 48475d1cc6..a66dcf8ab2 100644 --- a/sequencer.c +++ b/sequencer.c @@ -6229,7 +6229,7 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla if (checkout_onto(r, opts, onto_name, &oid, orig_head)) goto cleanup; - if (require_clean_work_tree(r, "rebase", "", 1, 1)) + if (require_clean_work_tree(r, "rebase", NULL, 1, 1)) goto cleanup; todo_list_write_total_nr(&new_todo); diff --git a/wt-status.c b/wt-status.c index 5b1378965c..bdbcf73cbf 100644 --- a/wt-status.c +++ b/wt-status.c @@ -2655,8 +2655,12 @@ int require_clean_work_tree(struct repository *r, } if (err) { - if (hint) + if (hint) { + if (!*hint) + BUG("empty hint passed to require_clean_work_tree();" + " use NULL instead"); error("%s", hint); + } if (!gently) exit(128); } |