From 01f7821fa494b1d150e9f701bf84456bff072668 Mon Sep 17 00:00:00 2001 From: phanirithvij Date: Tue, 26 Nov 2024 18:15:42 +0530 Subject: [PATCH 1/2] init git config failure -> warn Signed-off-by: phanirithvij --- internal/cli/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/cli/main.go b/internal/cli/main.go index 10f272fb..1a1750be 100644 --- a/internal/cli/main.go +++ b/internal/cli/main.go @@ -92,13 +92,13 @@ func Initialize(ctx *cli.Context) { "Current git version: " + gitVersion) } - if err := git.InitGitConfig(); err != nil { - log.Fatal().Err(err).Send() - } - homePath := config.GetHomeDir() log.Info().Msg("Data directory: " + homePath) + if err := git.InitGitConfig(); err != nil { + log.Warn().Msg("Git config modification failed, ensure " + homePath + " is added to git safe directories, and receive.advertisePushOptions is set to true.") + } + if err := createSymlink(homePath, ctx.String("config")); err != nil { log.Fatal().Err(err).Msg("Failed to create symlinks") } From 789a4e8be3bafc088e02c1f2085e8ccca08a9c2e Mon Sep 17 00:00:00 2001 From: Thomas Miceli Date: Tue, 26 Nov 2024 22:23:29 +0100 Subject: [PATCH 2/2] Change error message --- internal/cli/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cli/main.go b/internal/cli/main.go index 1a1750be..4c980fd2 100644 --- a/internal/cli/main.go +++ b/internal/cli/main.go @@ -96,7 +96,7 @@ func Initialize(ctx *cli.Context) { log.Info().Msg("Data directory: " + homePath) if err := git.InitGitConfig(); err != nil { - log.Warn().Msg("Git config modification failed, ensure " + homePath + " is added to git safe directories, and receive.advertisePushOptions is set to true.") + log.Warn().Err(err).Msgf("Failed to change the host's git global config, ensure to add to `safe.directory` the path %s, and `receive.advertisePushOptions` is set to true.", homePath) } if err := createSymlink(homePath, ctx.String("config")); err != nil {