Avoid converting .git file in a worktree or submodule to a symlink when the repository is not a git-annex repository.

This means it will still be a .git file when git-annex init runs. That's
ok, the repo probably contains no annexed objects yet, and even if it does,
git-annex init does not care if symlinks in the worktree don't point to the
objects.

I made init, at the end, run the conversion code. Not really necessary
because the next git-annex command could do it just as well. But, this
avoids commands that don't normally write to the repo needing to write to
it, which might avoid some problem or other, and seems worth avoiding
generally.
This commit is contained in:
Joey Hess 2020-03-09 14:45:14 -04:00
parent c0a981cb0e
commit d930a2035c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 37 additions and 22 deletions

View file

@ -65,3 +65,4 @@ Linux ip-172-31-80-211.ec2.internal 4.14.171-136.231.amzn2.x86_64 #1 SMP Thu Feb
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
> [[fixed|done]] --[[Joey]]

View file

@ -0,0 +1,14 @@
[[!comment format=mdwn
username="joey"
subject="""comment 1"""
date="2020-03-09T18:31:46Z"
content="""
Hmm, fixupUnusualRepos was earlier changed to check for .noannex
files, and avoid doing anything. Didn't think big enough I suppose.
I agree, git-annex should not be hacking on git repos that have not had
git-annex initialized in them yet. Luckily all the hacks are about making
.git files into symlinks so links to annexed files work, so it will be ok
for the .git file to remain unconverted until the end of git-annex init,
or even by a subsequent git-annex command.
"""]]