diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-01-16 13:06:35 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-01-16 13:06:35 -0800 |
| commit | 8cf646faac355fb44199793fe1a080b82abffc29 (patch) | |
| tree | 4de43a7fbb7d1443980368f5972957c0850b0904 /builtin/branch.c | |
| parent | a54a84b333adbecf7bc4483c0e36ed5878cac17b (diff) | |
| parent | bec9bb4b3918d2b3c7b91bbb116a667d5d6d298d (diff) | |
| download | git-8cf646faac355fb44199793fe1a080b82abffc29.tar.gz | |
Merge branch 'rj/advice-delete-branch-not-fully-merged' into rj/advice-disable-how-to-disable
* rj/advice-delete-branch-not-fully-merged:
branch: make the advice to force-deleting a conditional one
advice: fix an unexpected leading space
advice: sort the advice related lists
Diffstat (limited to 'builtin/branch.c')
| -rw-r--r-- | builtin/branch.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index 0a32d1b6c8..cfb63cce5f 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -24,6 +24,7 @@ #include "ref-filter.h" #include "worktree.h" #include "help.h" +#include "advice.h" #include "commit-reach.h" static const char * const builtin_branch_usage[] = { @@ -190,9 +191,10 @@ static int check_branch_commit(const char *branchname, const char *refname, return -1; } if (!force && !branch_merged(kinds, branchname, rev, head_rev)) { - error(_("the branch '%s' is not fully merged.\n" - "If you are sure you want to delete it, " - "run 'git branch -D %s'"), branchname, branchname); + error(_("the branch '%s' is not fully merged"), branchname); + advise_if_enabled(ADVICE_FORCE_DELETE_BRANCH, + _("If you are sure you want to delete it, " + "run 'git branch -D %s'"), branchname); return -1; } return 0; |
