Skip to content

Commit ba61ff4

Browse files
authored
Allow overriding name of a repository (#47)
By specifying a "name" in the manifest, the repository will be checked out under the given name instead of auto-detecting the name from the repository name. This is helpful when a fork of the graylog2-server repository is used. The Graylog project build relies on the server repository being checked out as "graylog2-server". Without this change, a repository "Graylog2/graylog2-server-fork.git" would be checked out as "graylog2-server-fork". With this change, it can be named "graylog2-server" with the git remote still pointing at "Graylog2/graylog2-server-fork.git".
1 parent b8a6a2d commit ba61ff4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

manifest/manifest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type Manifest struct {
2020
}
2121

2222
type ManifestModule struct {
23+
Name string `json:"name,omitempty"`
2324
Repository string `json:"repository,omitempty"`
2425
Revision string `json:"revision,omitempty"`
2526
Maven string `json:"maven,omitempty"`

project/project.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func New(config config.Config, manifestFiles []string, options ...projectOption)
185185
}
186186

187187
for _, module := range readManifest.Modules {
188-
moduleName := utils.NameFromRepository(module.Repository)
188+
moduleName, _ := utils.FirstNonEmpty(module.Name, utils.NameFromRepository(module.Repository))
189189
moduleRepository := module.Repository
190190
submodules := make([]Module, 0)
191191

0 commit comments

Comments
 (0)