From 40f801d4f75ce7121e21f8a0513966c2f71ef436 Mon Sep 17 00:00:00 2001 From: roi-codefresh Date: Sun, 19 Mar 2023 17:19:00 +0200 Subject: [PATCH] fix validating write permissions on --recover (#443) Signed-off-by: roi.kramer --- cmd/commands/repo.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/commands/repo.go b/cmd/commands/repo.go index 1de1a4f5..52e6c9d2 100644 --- a/cmd/commands/repo.go +++ b/cmd/commands/repo.go @@ -146,7 +146,14 @@ func NewRepoBootstrapCommand() *cobra.Command { repo bootstrap --repo https://github.com/example/repo/path/to/installation_root `), - PreRun: func(_ *cobra.Command, _ []string) { cloneOpts.Parse() }, + PreRun: func(_ *cobra.Command, _ []string) { + cloneOpts.Parse() + if recover { + // in recover mode we don't want to commit anything + cloneOpts.CloneForWrite = false + cloneOpts.CreateIfNotExist = false + } + }, RunE: func(cmd *cobra.Command, args []string) error { return RunRepoBootstrap(cmd.Context(), &RepoBootstrapOptions{ AppSpecifier: appSpecifier,