Skip to content

Commit

Permalink
fix: git client branch function (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
huhudev-git authored Jun 11, 2021
1 parent 7708118 commit 45e6486
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/git/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,13 +566,13 @@ func (m *nativeGitClient) Commit(pathSpec string, opts *CommitOptions) error {
// Branch creates a new target branch from a given source branch
func (m *nativeGitClient) Branch(sourceBranch string, targetBranch string) error {
if sourceBranch != "" {
_, err := m.runCmd("git", "checkout", sourceBranch)
_, err := m.runCmd("checkout", sourceBranch)
if err != nil {
return fmt.Errorf("could not checkout source branch: %v", err)
}
}

_, err := m.runCmd("git", "branch", targetBranch)
_, err := m.runCmd("branch", targetBranch)
if err != nil {
return fmt.Errorf("could not create new branch: %v", err)
}
Expand Down

0 comments on commit 45e6486

Please sign in to comment.