Skip to content

Commit

Permalink
Merge pull request #251 from lucas-zmroczek-apl/93-gitlab-nested-repos
Browse files Browse the repository at this point in the history
handle nested repos in init for GitLab
  • Loading branch information
jakegut authored Oct 30, 2024
2 parents c9120b5 + d7b3a69 commit ea52773
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.34
0.0.35
3 changes: 2 additions & 1 deletion initialize/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ func reposFromFile(p *lib.Provider, file string) ([]lib.Repo, error) {
// in case file ends with newline, ignore it
continue
}
parts := strings.Split(item, "/")
// GitLab may have nested directories
parts := strings.SplitN(item, "/", 2)
if len(parts) != 2 {
return []lib.Repo{}, fmt.Errorf("unable determine repo from line, expected format '{org}/{repo}': %s", item)
}
Expand Down
4 changes: 2 additions & 2 deletions merge/mergeGitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ func GitlabMerge(ctx context.Context, input Input, repoLimiter *time.Ticker, mer
return Output{Success: false}, fmt.Errorf("MR is not approved. Review state is %s", mr.State)
}
}
// Try to rebase master if Diverged Commits greates that zero
// Try to rebase master if Diverged Commits greater than zero
if mr.DivergedCommitsCount > 0 {
_, err := client.MergeRequests.RebaseMergeRequest(pid, input.PRNumber, ctxFunc)
_, err := client.MergeRequests.RebaseMergeRequest(pid, input.PRNumber, &gitlab.RebaseMergeRequestOptions{}, ctxFunc)
if err != nil {
return Output{Success: false}, fmt.Errorf("Failed to rebase from master")
}
Expand Down

0 comments on commit ea52773

Please sign in to comment.