Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <jortel@redhat.com>
  • Loading branch information
jortel committed Nov 21, 2024
1 parent e7e1c0d commit b705252
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions repository/subversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,20 @@ func (r *Subversion) Fetch() (err error) {

// Branch checks out a branch.
// The branch is created as needed. The Remote.URL will be set to the branchURL.
// Example: Branch("/branches/stable")
func (r *Subversion) Branch(name string) (err error) {
func (r *Subversion) Branch(branchURL string) (err error) {
branch := Subversion{
Authenticated: r.Authenticated,
Remote: r.Remote,
Path: r.Path,
}
branch.Remote.Branch = name
u := branch.URL()
_, err = urllib.Parse(branchURL)
if err != nil {
return
}
branch.Remote.URL = branchURL
defer func() {
if err == nil {
r.Remote.URL = u.String()
r.Remote.URL = branch.Remote.URL
}
}()
err = branch.checkout()
Expand Down

0 comments on commit b705252

Please sign in to comment.