mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
When checking out a remote branch by name, ask the user how
The choices are to create a new local branch that tracks the remote, or a detached head.
This commit is contained in:
parent
0360b82aab
commit
e42cbf95ae
4 changed files with 94 additions and 0 deletions
|
@ -28,6 +28,17 @@ func (self *BranchCommands) New(name string, base string) error {
|
|||
return self.cmd.New(cmdArgs).Run()
|
||||
}
|
||||
|
||||
// CreateWithUpstream creates a new branch with a given upstream, but without
|
||||
// checking it out
|
||||
func (self *BranchCommands) CreateWithUpstream(name string, upstream string) error {
|
||||
cmdArgs := NewGitCmd("branch").
|
||||
Arg("--track").
|
||||
Arg(name, upstream).
|
||||
ToArgv()
|
||||
|
||||
return self.cmd.New(cmdArgs).Run()
|
||||
}
|
||||
|
||||
// CurrentBranchInfo get the current branch information.
|
||||
func (self *BranchCommands) CurrentBranchInfo() (BranchInfo, error) {
|
||||
branchName, err := self.cmd.New(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue