Skip to content

Commit ea52773

Browse files
authored
Merge pull request #251 from lucas-zmroczek-apl/93-gitlab-nested-repos
handle nested repos in init for GitLab
2 parents c9120b5 + d7b3a69 commit ea52773

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.34
1+
0.0.35

initialize/initialize.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ func reposFromFile(p *lib.Provider, file string) ([]lib.Repo, error) {
109109
// in case file ends with newline, ignore it
110110
continue
111111
}
112-
parts := strings.Split(item, "/")
112+
// GitLab may have nested directories
113+
parts := strings.SplitN(item, "/", 2)
113114
if len(parts) != 2 {
114115
return []lib.Repo{}, fmt.Errorf("unable determine repo from line, expected format '{org}/{repo}': %s", item)
115116
}

merge/mergeGitlab.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ func GitlabMerge(ctx context.Context, input Input, repoLimiter *time.Ticker, mer
6464
return Output{Success: false}, fmt.Errorf("MR is not approved. Review state is %s", mr.State)
6565
}
6666
}
67-
// Try to rebase master if Diverged Commits greates that zero
67+
// Try to rebase master if Diverged Commits greater than zero
6868
if mr.DivergedCommitsCount > 0 {
69-
_, err := client.MergeRequests.RebaseMergeRequest(pid, input.PRNumber, ctxFunc)
69+
_, err := client.MergeRequests.RebaseMergeRequest(pid, input.PRNumber, &gitlab.RebaseMergeRequestOptions{}, ctxFunc)
7070
if err != nil {
7171
return Output{Success: false}, fmt.Errorf("Failed to rebase from master")
7272
}

0 commit comments

Comments
 (0)