CheckoutNewBranch checks out to a new branch from the a branch name.
(oldBranch, newBranch string)
| 107 | |
| 108 | // CheckoutNewBranch checks out to a new branch from the a branch name. |
| 109 | func (r *Repository) CheckoutNewBranch(oldBranch, newBranch string) error { |
| 110 | if err := git.Checkout(r.LocalCopyPath(), newBranch, git.CheckoutOptions{ |
| 111 | BaseBranch: oldBranch, |
| 112 | Timeout: time.Duration(conf.Git.Timeout.Pull) * time.Second, |
| 113 | }); err != nil { |
| 114 | return errors.Newf("checkout [base: %s, new: %s]: %v", oldBranch, newBranch, err) |
| 115 | } |
| 116 | return nil |
| 117 | } |
| 118 | |
| 119 | // hasSymlinkInPath returns true if there is any symlink in path hierarchy using |
| 120 | // the given base and relative path. |
no test coverage detected