]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ob/sequencer-empty-hint-fix' into maint-2.42
authorJunio C Hamano <gitster@pobox.com>
Thu, 2 Nov 2023 07:53:16 +0000 (16:53 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Nov 2023 07:53:16 +0000 (16:53 +0900)
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()

sequencer.c
wt-status.c

index 828efd589deff91a67804951176b689d63a4cf18..bc6b7b6a7680b20a7d80f9c1be9a9df9d2f4d0f5 100644 (file)
@@ -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);
index 5b1378965c9aa37505a23cf9c472f1abe4d8503e..bdbcf73cbf482ad87ac974a6ef3b21cfc80c1411 100644 (file)
@@ -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);
        }