Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

gps: Refactor prune and filesystem functions #1219

Merged
merged 11 commits into from
Dec 18, 2017
10 changes: 5 additions & 5 deletions cmd/dep/ensure.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (cmd *ensureCommand) runDefault(ctx *dep.Ctx, args []string, p *dep.Project
// that "verification" is supposed to look like (#121); in the meantime,
// we unconditionally write out vendor/ so that `dep ensure`'s behavior
// is maximally compatible with what it will eventually become.
sw, err := dep.NewSafeWriter(nil, p.Lock, p.Lock, dep.VendorAlways)
sw, err := dep.NewSafeWriter(nil, p.Lock, p.Lock, dep.VendorAlways, p.Manifest.PruneOptions)
if err != nil {
return err
}
Expand All @@ -290,7 +290,7 @@ func (cmd *ensureCommand) runDefault(ctx *dep.Ctx, args []string, p *dep.Project
return handleAllTheFailuresOfTheWorld(err)
}

sw, err := dep.NewSafeWriter(nil, p.Lock, dep.LockFromSolution(solution), cmd.vendorBehavior())
sw, err := dep.NewSafeWriter(nil, p.Lock, dep.LockFromSolution(solution), cmd.vendorBehavior(), p.Manifest.PruneOptions)
if err != nil {
return err
}
Expand All @@ -315,7 +315,7 @@ func (cmd *ensureCommand) runVendorOnly(ctx *dep.Ctx, args []string, p *dep.Proj
}
// Pass the same lock as old and new so that the writer will observe no
// difference and choose not to write it out.
sw, err := dep.NewSafeWriter(nil, p.Lock, p.Lock, dep.VendorAlways)
sw, err := dep.NewSafeWriter(nil, p.Lock, p.Lock, dep.VendorAlways, p.Manifest.PruneOptions)
if err != nil {
return err
}
Expand Down Expand Up @@ -380,7 +380,7 @@ func (cmd *ensureCommand) runUpdate(ctx *dep.Ctx, args []string, p *dep.Project,
return handleAllTheFailuresOfTheWorld(err)
}

sw, err := dep.NewSafeWriter(nil, p.Lock, dep.LockFromSolution(solution), cmd.vendorBehavior())
sw, err := dep.NewSafeWriter(nil, p.Lock, dep.LockFromSolution(solution), cmd.vendorBehavior(), p.Manifest.PruneOptions)
if err != nil {
return err
}
Expand Down Expand Up @@ -679,7 +679,7 @@ func (cmd *ensureCommand) runAdd(ctx *dep.Ctx, args []string, p *dep.Project, sm
}
sort.Strings(reqlist)

sw, err := dep.NewSafeWriter(nil, p.Lock, dep.LockFromSolution(solution), dep.VendorOnChanged)
sw, err := dep.NewSafeWriter(nil, p.Lock, dep.LockFromSolution(solution), dep.VendorOnChanged, p.Manifest.PruneOptions)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/dep/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error {
ctx.Err.Printf("Old vendor backed up to %v", vendorbak)
}

sw, err := dep.NewSafeWriter(p.Manifest, nil, p.Lock, dep.VendorAlways)
sw, err := dep.NewSafeWriter(p.Manifest, nil, p.Lock, dep.VendorAlways, gps.DefaultRootPruneOptions())
if err != nil {
return errors.Wrap(err, "init failed: unable to create a SafeWriter")
}
Expand Down
1 change: 0 additions & 1 deletion cmd/dep/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func (c *Config) Run() int {
&statusCommand{},
&ensureCommand{},
&hashinCommand{},
&pruneCommand{},
&versionCommand{},
}

Expand Down
206 changes: 0 additions & 206 deletions cmd/dep/prune.go

This file was deleted.

50 changes: 0 additions & 50 deletions cmd/dep/prune_test.go

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading