V4: prevent git's 'dubious ownership' error

This commit is contained in:
Tim Hockin 2023-03-16 16:10:50 -07:00
parent f287d63171
commit 45c7b89674
1 changed files with 4 additions and 0 deletions

View File

@ -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 {