create journal directory in withJournalHandle

Fixes a crash by git-annex repair when .git/annex/journal/ does not exist.

Normally the journal directory is created before withJournalHandle gets
run, but git-annex repair can be run in a situation where it does not
exist.
This commit is contained in:
Joey Hess 2023-06-21 15:23:59 -04:00
parent aa8be9850a
commit 928b2a4839
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 29 additions and 2 deletions

View file

@ -48,3 +48,5 @@ I did that because annexed objects are 1.7TB big here, so I wanted a local copy
I'll keep the repo lying around for a few days, maybe weeks, if some experiment or further feedback is needed.
Thank you for your attention.
> [[fixed|done]].. sorry for the delay and thanks for reporting --[[Joey]]

View file

@ -0,0 +1,19 @@
[[!comment format=mdwn
username="joey"
subject="""comment 1"""
date="2023-06-21T18:53:31Z"
content="""
I was able to reproduce this bug!
git-annex init
rm -rf .git/annex
git-annex repair
git-annex: .git/annex/journal/: openDirStream: does not exist (No such file or directory)
That's with Annex.Repair modified to always run commitindex. Having a
repository with a git-annex branch that is corrupt, would have the same effect
as that modification.
Fixed this.
"""]]