speed up init
This was making it git checkout master when that branch was already checked out, for apparently no good reason at all. In a 100,000 file repo, that takes about 1 second. Note, I'm not sure why it checks out the branch in the Nothing case, so I left that alone.
This commit is contained in:
parent
5d78cd9d08
commit
1e3b228154
1 changed files with 3 additions and 2 deletions
|
@ -70,11 +70,12 @@ switchHEADBack = maybe noop switch =<< inRepo Git.Branch.currentUnsafe
|
||||||
let orighead = fromDirectBranch currhead
|
let orighead = fromDirectBranch currhead
|
||||||
inRepo (Git.Ref.sha currhead) >>= \case
|
inRepo (Git.Ref.sha currhead) >>= \case
|
||||||
Just headsha
|
Just headsha
|
||||||
| orighead /= currhead -> do
|
| orighead == currhead -> noop
|
||||||
|
| otherwise -> do
|
||||||
inRepo $ Git.Branch.update "leaving direct mode" orighead headsha
|
inRepo $ Git.Branch.update "leaving direct mode" orighead headsha
|
||||||
inRepo $ Git.Branch.checkout orighead
|
inRepo $ Git.Branch.checkout orighead
|
||||||
inRepo $ Git.Branch.delete currhead
|
inRepo $ Git.Branch.delete currhead
|
||||||
_ -> inRepo $ Git.Branch.checkout orighead
|
Nothing -> inRepo $ Git.Branch.checkout orighead
|
||||||
|
|
||||||
{- Absolute FilePaths of Files in the tree that are associated with a key. -}
|
{- Absolute FilePaths of Files in the tree that are associated with a key. -}
|
||||||
associatedFiles :: Key -> Annex [FilePath]
|
associatedFiles :: Key -> Annex [FilePath]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue