From 45c7b89674c6a94b68fb60c1219b8345e7b1da90 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Thu, 16 Mar 2023 16:10:50 -0700 Subject: [PATCH] V4: 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 1660c19..4c2f0b5 100644 --- a/cmd/git-sync/main.go +++ b/cmd/git-sync/main.go @@ -1967,6 +1967,10 @@ func (git *repoSync) SetupDefaultGitConfigs(ctx context.Context) error { // How to manage credentials (for those modes that need it). key: "credential.helper", val: "cache --timeout 3600", + }, { + // Mark repos as safe (avoid a "dubious ownership" error). + key: "safe.directory", + val: "*", }} for _, kv := range configs { if _, err := git.Run(ctx, "", "config", "--global", kv.key, kv.val); err != nil {