Skip to content

Commit 3daf577

Browse files
authored
Merge pull request #16 from akihikokuroda/local
Support promotion from local directories, and not just https:// repositories.
2 parents 42061bb + 5b8f5c1 commit 3daf577

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/avancement/service_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func addCredentialsIfNecessary(s string, a *git.Author) (string, error) {
153153
if err != nil {
154154
return "", fmt.Errorf("failed to parse git repo url %v: %w", s, err)
155155
}
156-
if parsed.User != nil {
156+
if parsed.Scheme != "https" || parsed.User != nil {
157157
return s, nil
158158
}
159159
parsed.User = url.UserPassword("promotion", a.Token)

pkg/avancement/service_manager_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func TestAddCredentials(t *testing.T) {
5454
{"https://testing.example.com/test", testUser, "https://promotion:[email protected]/test"},
5555
{"https://promotion:[email protected]/test", testUser, "https://promotion:[email protected]/test"},
5656
{"https://testing:[email protected]/test", testUser, "https://testing:[email protected]/test"},
57+
{"/mydir/test", testUser, "/mydir/test"},
5758
}
5859

5960
for i, tt := range tests {

0 commit comments

Comments
 (0)