mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-04 05:10:40 +00:00
properly expose AcquireByHash through the api
- new publish calls can now enable AcquireByHash by right away (previously one would have had to create a new publishing endpoint and then explicitly switch it to AcquireByHash) - all json marshals of PublishedRepo now contain AcquireByHash (allows inspecting if a given endpoint has AcquireByHash enabled already; also enables verification that a switch/update actually applied a potential AcquireByHash change - update all tests to reflect that default state of AcquireByHash - update creation and switch testing to explicitly toggle AcquireByHash to make sure state mutation works as expected
This commit is contained in:
@@ -104,6 +104,7 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
|
||||
SkipContents *bool
|
||||
Architectures []string
|
||||
Signing SigningOptions
|
||||
AcquireByHash *bool
|
||||
}
|
||||
|
||||
if c.Bind(&b) != nil {
|
||||
@@ -201,6 +202,10 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
|
||||
published.SkipContents = *b.SkipContents
|
||||
}
|
||||
|
||||
if b.AcquireByHash != nil {
|
||||
published.AcquireByHash = *b.AcquireByHash
|
||||
}
|
||||
|
||||
duplicate := collection.CheckDuplicate(published)
|
||||
if duplicate != nil {
|
||||
context.CollectionFactory().PublishedRepoCollection().LoadComplete(duplicate, context.CollectionFactory())
|
||||
|
||||
Reference in New Issue
Block a user