mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-04 05:43:37 +09:00
tools/bump: refuse a batch that moves a requirement backwards
Diffing go.mod catches a downgrade wherever selection produced it; reading what go get printed only catches what go get did itself. The lockstep partners are exempt, since repin lowers them on purpose.
This commit is contained in:
+16
-1
@@ -68,6 +68,11 @@ func applyAtoms(ctx context.Context, r *repo, atoms []atom) ([]string, []dropped
|
||||
// applySet applies every atom, settles go.mod and asks the atom gate whether
|
||||
// the result is viable.
|
||||
func applySet(ctx context.Context, r *repo, atoms []atom) ([]string, error) {
|
||||
before, err := parseGoMod(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
summaries := make([]string, 0, len(atoms))
|
||||
|
||||
for _, a := range atoms {
|
||||
@@ -83,7 +88,17 @@ func applySet(ctx context.Context, r *repo, atoms []atom) ([]string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
err := settle(ctx, r)
|
||||
err = settle(ctx, r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
after, err := parseGoMod(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = checkDowngrades(before, after)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user