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:
parent
c0a981cb0e
commit
d930a2035c
5 changed files with 37 additions and 22 deletions
|
@ -34,6 +34,7 @@ import Annex.Version
|
|||
import Annex.Difference
|
||||
import Annex.UUID
|
||||
import Annex.WorkTree
|
||||
import Annex.Fixup
|
||||
import Config
|
||||
import Config.Files
|
||||
import Config.Smudge
|
||||
|
@ -129,6 +130,7 @@ initialize' mversion = checkCanInitialize $ do
|
|||
)
|
||||
propigateSecureHashesOnly
|
||||
createInodeSentinalFile False
|
||||
fixupUnusualReposAfterInit
|
||||
|
||||
uninitialize :: Annex ()
|
||||
uninitialize = do
|
||||
|
@ -280,3 +282,8 @@ propigateSecureHashesOnly :: Annex ()
|
|||
propigateSecureHashesOnly =
|
||||
maybe noop (setConfig "annex.securehashesonly" . fromConfigValue)
|
||||
=<< getGlobalConfig "annex.securehashesonly"
|
||||
|
||||
fixupUnusualReposAfterInit :: Annex ()
|
||||
fixupUnusualReposAfterInit = do
|
||||
gc <- Annex.getGitConfig
|
||||
void $ inRepo $ \r -> fixupUnusualRepos r gc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue