From c1564ce0830fcda1f7f0d28097d75c555f02dcad Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Thu, 16 Mar 2023 12:43:30 -0700 Subject: [PATCH] V3: prevent git's 'dubious ownership' error --- cmd/git-sync/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/git-sync/main.go b/cmd/git-sync/main.go index 01ce454..60550ed 100644 --- a/cmd/git-sync/main.go +++ b/cmd/git-sync/main.go @@ -1285,6 +1285,10 @@ func setupDefaultGitConfigs(ctx context.Context) error { // How to manage credentials (for those modes that need it). key: "credential.helper", val: "cache --timeout 3600", + }, { + // Our working root is safe (avoid a "dubious ownership" error). + key: "safe.directory", + val: "*", }} for _, kv := range configs { if _, err := cmdRunner.Run(ctx, "", nil, *flGitCmd, "config", "--global", kv.key, kv.val); err != nil {