Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bzr.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewBzrRepo(remote, local string) (*BzrRepo, error) {

// If no remote was passed in but one is configured for the locally
// checked out Bzr repo use that one.
if m[1] != "" {
if m != nil && m[1] != "" {
r.setRemote(m[1])
}
}
Expand Down
18 changes: 10 additions & 8 deletions hg.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ func NewHgRepo(remote, local string) (*HgRepo, error) {
}

m := hgDetectURL.FindStringSubmatch(string(out))
if remote != "" && m[1] != remote {
return nil, ErrWrongRemote
}

// If no remote was passed in but one is configured for the locally
// checked out Hg repo use that one.
if remote == "" && m[1] != "" {
r.setRemote(m[1])
if m != nil {
if remote != "" && m[1] != remote {
return nil, ErrWrongRemote
}

// If no remote was passed in but one is configured for the locally
// checked out Hg repo use that one.
if remote == "" && m[1] != "" {
r.setRemote(m[1])
}
}
}

Expand Down
Loading