Merge branch 'ab/checkout-branch-info-leakfix'

We added an unrelated sanity checking that leads to a BUG() while
plugging a leak, which triggered in a repository with symrefs in
the local branch namespace that point at a ref outside.  Partially
revert the change to avoid triggering the BUG().

* ab/checkout-branch-info-leakfix:
  checkout: avoid BUG() when hitting a broken repository
This commit is contained in:
Junio C Hamano
2022-01-24 09:14:46 -08:00
2 changed files with 13 additions and 3 deletions

View File

@ -1094,9 +1094,6 @@ static int switch_branches(const struct checkout_opts *opts,
const char *p;
if (skip_prefix(old_branch_info.path, prefix, &p))
old_branch_info.name = xstrdup(p);
else
BUG("should be able to skip past '%s' in '%s'!",
prefix, old_branch_info.path);
}
if (opts->new_orphan_branch && opts->orphan_from_empty_tree) {