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

Commit d596e65

Browse files
committed
gps: Supervise git cleanup, use new ct constant
1 parent d3d9967 commit d596e65

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

internal/gps/maybe_source.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ func (m maybeGitSource) try(ctx context.Context, cachedir string, c singleSource
105105
if r.CheckLocal() {
106106
state |= sourceExistsLocally
107107

108-
// If repository already exists on disk, make a pass to be sure
109-
// everything's clean.
110-
if err = src.cleanup(ctx); err != nil {
108+
if err := superv.do(ctx, "git", ctValidateLocal, func(ctx context.Context) error {
109+
// If repository already exists on disk, make a pass to be sure
110+
// everything's clean.
111+
return src.cleanup(ctx)
112+
}); err != nil {
111113
return nil, 0, err
112114
}
113115
}

internal/gps/source_manager.go

+1
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ const (
739739
ctSourceInit
740740
ctSourceFetch
741741
ctExportTree
742+
ctValidateLocal
742743
)
743744

744745
func (ct callType) String() string {

0 commit comments

Comments
 (0)