diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-10-12 13:51:41 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-12 13:51:41 -0700 |
commit | 474e4f9b5567e02e9c6947e36ed84f882868d77e (patch) | |
tree | f3f1b5b35a54047bfd6d543351b0b7216e8df990 /builtin/branch.c | |
parent | cd9a57f6a040116f866ada47317c91262688a0ed (diff) | |
parent | 597a97748924e8ce0b829f668acc8f7a6849b05f (diff) | |
download | git-474e4f9b5567e02e9c6947e36ed84f882868d77e.tar.gz |
Merge branch 'rs/branch-allow-deleting-dangling' into maint
"git branch -D <branch>" used to refuse to remove a broken branch
ref that points at a missing commit, which has been corrected.
* rs/branch-allow-deleting-dangling:
branch: allow deleting dangling branches with --force
Diffstat (limited to 'builtin/branch.c')
-rw-r--r-- | builtin/branch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index b23b1d1752..03c7b7253a 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -168,7 +168,7 @@ static int check_branch_commit(const char *branchname, const char *refname, int kinds, int force) { struct commit *rev = lookup_commit_reference(the_repository, oid); - if (!rev) { + if (!force && !rev) { error(_("Couldn't look up commit object for '%s'"), refname); return -1; } |