]> dgit.raspbian.org Git - git-annex.git/commit
Avoid crashing when run in a bare git repo that somehow contains an index file
authorJoey Hess <joeyh@joeyh.name>
Tue, 11 Jan 2022 17:01:49 +0000 (13:01 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 11 Jan 2022 17:01:49 +0000 (13:01 -0400)
commitf54c58f0df57dd8c646c52d1ad789e522efa97fa
treeb895a96138eac45cda27177b9510619646493b2b
parentc031d19c32d487ad548e41f62d029a39b3b340e9
Avoid crashing when run in a bare git repo that somehow contains an index file

Do not populate the keys database with associated files,
because a bare repo has no working tree, and so it does not make sense to
populate it.

Queries of associated files in the keys database always return empty lists
in a bare repo, even if it's somehow populated. One way it could be
populated is if a user converts a non-bare repo to a bare repo.

Note that Git.Config.isBare does a string comparison, so this is not free!
But, that string comparison is very small compared to a sqlite query.

Sponsored-by: Erik Bjäreholt on Patreon
CHANGELOG
Database/Keys.hs
doc/bugs/Repo_manipulation_breaks_git-annex_drop_--all.mdwn
doc/bugs/Repo_manipulation_breaks_git-annex_drop_--all/comment_1_22fb9214e6e31d04b0ffe3266d26ea69._comment [new file with mode: 0644]