Skip to content

Commit ab2b33c

Browse files
committed
Rename to CleanPath
Signed-off-by: Yoshiki Fujikane <[email protected]>
1 parent 122119f commit ab2b33c

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

pkg/app/piped/driftdetector/kubernetes/detector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (d *detector) check(ctx context.Context) {
179179
zap.String("app-id", app.Id),
180180
zap.String("app-path", app.GitPath.Path),
181181
)
182-
if err := gitRepo.CleanPartially(ctx, app.GitPath.Path); err != nil {
182+
if err := gitRepo.CleanPath(ctx, app.GitPath.Path); err != nil {
183183
d.logger.Error("failed to clean partially cloned repository",
184184
zap.String("repo-id", repoID),
185185
zap.String("app-id", app.Id),

pkg/git/gittest/git.mock.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/git/repo.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type Repo interface {
4343
Checkout(ctx context.Context, commitish string) error
4444
CheckoutPullRequest(ctx context.Context, number int, branch string) error
4545
Clean() error
46-
CleanPartially(ctx context.Context, relativePath string) error
46+
CleanPath(ctx context.Context, relativePath string) error
4747

4848
Pull(ctx context.Context, branch string) error
4949
MergeRemoteBranch(ctx context.Context, branch, commit, mergeCommitMessage string) error
@@ -260,8 +260,8 @@ func (r repo) Clean() error {
260260
return os.RemoveAll(r.dir)
261261
}
262262

263-
// CleanPartially deletes data in the given relative path in the repo with git clean.
264-
func (r repo) CleanPartially(ctx context.Context, relativePath string) error {
263+
// CleanPath deletes data in the given relative path in the repo with git clean.
264+
func (r repo) CleanPath(ctx context.Context, relativePath string) error {
265265
out, err := r.runGitCommand(ctx, "clean", "-f", relativePath)
266266
if err != nil {
267267
return formatCommandError(err, out)

pkg/git/repo_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func TestGetCommitForRev(t *testing.T) {
280280
assert.Equal(t, commits[0].Hash, commit.Hash)
281281
}
282282

283-
func TestCleanPartially(t *testing.T) {
283+
func TestCleanPath(t *testing.T) {
284284
faker, err := newFaker()
285285
require.NoError(t, err)
286286
defer faker.clean()
@@ -313,7 +313,7 @@ func TestCleanPartially(t *testing.T) {
313313
}
314314

315315
// clean the repo-dir/part1
316-
err = r.CleanPartially(ctx, "part1")
316+
err = r.CleanPath(ctx, "part1")
317317
require.NoError(t, err)
318318

319319
// check the repo-dir/part1 is removed

0 commit comments

Comments
 (0)