Skip to content

The current directory is not a valid dolt repository. inconsistently reported inside a dolt repository #10230

@platy

Description

@platy

Hi, I'm new to dolt and evaluating it for our use case.

I was working on quite a large number of changes in my local dolt, then I realised I was on main and wanted to create a branch to work on, but got this error.

❯dolt checkout -b add_history
The current directory is not a valid dolt repository.
run: dolt init before trying to run this command

This error happened every time I tried to create a new branch like this, but dolt status showed my untracked changes, and dolt sql allowed making changes to the DB:

❯dolt status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "dolt add <table>" to update what will be committed)
  (use "dolt checkout <table>" to discard changes in working directory)
        deleted:          entries

Untracked tables:
  (use "dolt add <table>" to include in what will be committed)

Eventually I thought maybe that dolt init would fix the issue as it was telling me to do it, and I figured it wouldn't wipe my local repo, but ...

❯dolt init
Successfully initialized dolt data repository.

❯dolt status
On branch main
nothing to commit, working tree clean

So something strange is going on here, I would expect all dolt commands to consistently be able to tell if there is a dolt repo initialised, or report that the repo is corrupt somehow. And dolt init probably shouldn't wipe out an existing repo without confirmation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions