Merge branch 'ds/branch-checked-out' into ds/rebase-update-ref

* ds/branch-checked-out:
  branch: drop unused worktrees variable
  fetch: stop passing around unused worktrees variable
  branch: fix branch_checked_out() leaks
  branch: use branch_checked_out() when deleting refs
  fetch: use new branch_checked_out() and add tests
  branch: check for bisects and rebases
  branch: add branch_checked_out() helper
This commit is contained in:
Junio C Hamano
2022-07-12 08:38:42 -07:00
5 changed files with 224 additions and 45 deletions

View File

@ -101,6 +101,13 @@ void create_branches_recursively(struct repository *r, const char *name,
const char *tracking_name, int force,
int reflog, int quiet, enum branch_track track,
int dry_run);
/*
* If the branch at 'refname' is currently checked out in a worktree,
* then return the path to that worktree.
*/
const char *branch_checked_out(const char *refname);
/*
* Check if 'name' can be a valid name for a branch; die otherwise.
* Return 1 if the named branch already exists; return 0 otherwise.