summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-11-02 16:53:16 +0900
committerJunio C Hamano <gitster@pobox.com>2023-11-02 16:53:16 +0900
commita00b1127ce09bb963590faaef342618f719e7cc4 (patch)
tree7cc491da194a5961e35368c564c245faa5bcaa3d
parent7f8314f2770d3a0c82331a45242b8d7f346010ce (diff)
parenta9b5955e07793ceadaad05315c1599226d01292f (diff)
downloadgit-a00b1127ce09bb963590faaef342618f719e7cc4.tar.gz
Merge branch 'ob/sequencer-empty-hint-fix' into maint-2.42
The use of API between two calls to require_clean_work_tree() from the sequencer code has been cleaned up for consistency. * ob/sequencer-empty-hint-fix: sequencer: rectify empty hint in call of require_clean_work_tree()
-rw-r--r--sequencer.c2
-rw-r--r--wt-status.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c
index 828efd589d..bc6b7b6a76 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);
}