From 36cf61d7528d6cf69d5b678ecbbd4123d23b0a66 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 28 Aug 2019 15:46:35 -0400 Subject: [PATCH] simplification Whether or not there's a false index, it can't Restage here. When there's a false index, restaging would alter it and not the real index, but it fails anyway because that index is locked. When there's not a false index, the index is locked, and so restaging can't alter it. --- Command/PreCommit.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Command/PreCommit.hs b/Command/PreCommit.hs index 5672843d15..e65723740b 100644 --- a/Command/PreCommit.hs +++ b/Command/PreCommit.hs @@ -55,10 +55,7 @@ seek ps = lockPreCommitHook $ do -- files in the worktree won't -- be populated, so populate them -- here - ( Command.Smudge.updateSmudged - -- When there's a false index, - -- restaging the files won't work. - . Restage =<< liftIO Git.haveFalseIndex + ( Command.Smudge.updateSmudged (Restage False) -- inject unlocked files into the annex -- (not needed when repo version uses -- unlocked pointer files)