Skip to content

Commit 40f801d

Browse files
fix validating write permissions on --recover (#443)
Signed-off-by: roi.kramer <[email protected]>
1 parent 9f3b0cc commit 40f801d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/commands/repo.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,14 @@ func NewRepoBootstrapCommand() *cobra.Command {
146146
147147
<BIN> repo bootstrap --repo https://github.com/example/repo/path/to/installation_root
148148
`),
149-
PreRun: func(_ *cobra.Command, _ []string) { cloneOpts.Parse() },
149+
PreRun: func(_ *cobra.Command, _ []string) {
150+
cloneOpts.Parse()
151+
if recover {
152+
// in recover mode we don't want to commit anything
153+
cloneOpts.CloneForWrite = false
154+
cloneOpts.CreateIfNotExist = false
155+
}
156+
},
150157
RunE: func(cmd *cobra.Command, args []string) error {
151158
return RunRepoBootstrap(cmd.Context(), &RepoBootstrapOptions{
152159
AppSpecifier: appSpecifier,

0 commit comments

Comments
 (0)