jwiegley / gitlib

180 stars 56 forks source link

`repoAutoCreate = True` throws `GitException`: `"Could not find repository from /..."` when empty dir exists at `repoPath` #110

Open Atemu opened 6 months ago

Atemu commented 6 months ago

I tried to create a repo in a temp dir auto-generated by withSystemTempDirectory but it'd inexplicably throw a git exception.

After a bit of debugging I found out that it fails only when the given repoPath is empty; if it doesn't exist at all, it'll create the directory and repo.

I don't know how libgit works but this is contrary to how the git CLI works; you can git init an empty directory just fine.