From 650fb27e6ff003d958f5becaed68c81f18d1ac9d Mon Sep 17 00:00:00 2001 From: Corey Daley Date: Mon, 14 Aug 2023 22:37:15 -0400 Subject: [PATCH] Resolve fatal: detected dubious ownership in repository at '/workspace/source' --- cmd/git/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/git/main.go b/cmd/git/main.go index ff12f9107..98d515383 100644 --- a/cmd/git/main.go +++ b/cmd/git/main.go @@ -401,6 +401,11 @@ func clone(ctx context.Context) error { return err } + safeDirectoryArgs := []string{"config", "--global", "--add", "safe.directory", flagValues.target} + if _, err := git(ctx, safeDirectoryArgs...); err != nil { + return err + } + revision := flagValues.revision if revision == "" { // user requested to clone the default branch, determine the branch name