feat(init): dont restore all if creating a fresh repo
This commit is contained in:
parent
a985223387
commit
ec3737863c
1 changed files with 5 additions and 1 deletions
|
|
@ -199,6 +199,10 @@ func vcsInit(cmd *cobra.Command, args []string) error {
|
||||||
if err := writeGitignore(repoDir); err != nil {
|
if err := writeGitignore(repoDir); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(args) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return restoreAllSnapshots(store, repoDir)
|
return restoreAllSnapshots(store, repoDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -479,7 +483,7 @@ func restoreAllSnapshots(store *Store, repoDir string) error {
|
||||||
entries, err := os.ReadDir(targetDir)
|
entries, err := os.ReadDir(targetDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return fmt.Errorf("no repo directory found")
|
return fmt.Errorf("no existing stores found")
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue