fix(git): check out a local tracking branch when a remote branch is picked
This commit is contained in:
@@ -40,7 +40,7 @@ The following functions are exported and used by the web server:
|
||||
### Branch Operations
|
||||
- `getBranches(directory)`: Get list of local and remote branches (filtered to active remote branches).
|
||||
- `createBranch(directory, branchName, options)`: Create and checkout a new branch.
|
||||
- `checkoutBranch(directory, branchName)`: Checkout an existing branch.
|
||||
- `checkoutBranch(directory, branchName)`: Checkout an existing branch. A remote-tracking name (`origin/main`, or the `remotes/`-prefixed form) resolves to the local branch of that name, created with `--track` when it does not exist yet, because the branch selector offers remote branches as places to work rather than commits to inspect — a literal checkout of the remote ref would detach HEAD. A local branch whose own name looks like a remote ref wins over that resolution, and anything unresolvable is checked out as requested. The returned `branch` is the branch that was actually checked out, which callers should report instead of the requested name.
|
||||
- `deleteBranch(directory, branch, options)`: Delete a branch (supports force flag).
|
||||
- `renameBranch(directory, oldName, newName)`: Rename a branch and preserve upstream tracking.
|
||||
- `getRemotes(directory)`: Get list of configured remotes.
|
||||
|
||||
Reference in New Issue
Block a user