rename confusing function
The index.lck file is not a lock file. Kept the historical name for now as changing it would be work.
This commit is contained in:
parent
f2ee4ef86d
commit
83b4b8d589
2 changed files with 14 additions and 12 deletions
|
@ -351,18 +351,18 @@ forceUpdateIndex branchref = do
|
||||||
{- Checks if the index needs to be updated. -}
|
{- Checks if the index needs to be updated. -}
|
||||||
needUpdateIndex :: Git.Ref -> Annex Bool
|
needUpdateIndex :: Git.Ref -> Annex Bool
|
||||||
needUpdateIndex branchref = do
|
needUpdateIndex branchref = do
|
||||||
lock <- fromRepo gitAnnexIndexLock
|
f <- fromRepo gitAnnexIndexStatus
|
||||||
lockref <- Git.Ref . firstLine <$>
|
committedref <- Git.Ref . firstLine <$>
|
||||||
liftIO (catchDefaultIO "" $ readFileStrict lock)
|
liftIO (catchDefaultIO "" $ readFileStrict f)
|
||||||
return (lockref /= branchref)
|
return (committedref /= branchref)
|
||||||
|
|
||||||
{- Record that the branch's index has been updated to correspond to a
|
{- Record that the branch's index has been updated to correspond to a
|
||||||
- given ref of the branch. -}
|
- given ref of the branch. -}
|
||||||
setIndexSha :: Git.Ref -> Annex ()
|
setIndexSha :: Git.Ref -> Annex ()
|
||||||
setIndexSha ref = do
|
setIndexSha ref = do
|
||||||
lock <- fromRepo gitAnnexIndexLock
|
f <- fromRepo gitAnnexIndexStatus
|
||||||
liftIO $ writeFile lock $ show ref ++ "\n"
|
liftIO $ writeFile f $ show ref ++ "\n"
|
||||||
setAnnexPerm lock
|
setAnnexPerm f
|
||||||
|
|
||||||
{- Stages the journal into the index and returns an action that will
|
{- Stages the journal into the index and returns an action that will
|
||||||
- clean up the staged journal files, which should only be run once
|
- clean up the staged journal files, which should only be run once
|
||||||
|
|
12
Locations.hs
12
Locations.hs
|
@ -35,7 +35,7 @@ module Locations (
|
||||||
gitAnnexJournalDir,
|
gitAnnexJournalDir,
|
||||||
gitAnnexJournalLock,
|
gitAnnexJournalLock,
|
||||||
gitAnnexIndex,
|
gitAnnexIndex,
|
||||||
gitAnnexIndexLock,
|
gitAnnexIndexStatus,
|
||||||
gitAnnexIgnoredRefs,
|
gitAnnexIgnoredRefs,
|
||||||
gitAnnexPidFile,
|
gitAnnexPidFile,
|
||||||
gitAnnexDaemonStatusFile,
|
gitAnnexDaemonStatusFile,
|
||||||
|
@ -223,10 +223,12 @@ gitAnnexJournalLock r = gitAnnexDir r </> "journal.lck"
|
||||||
gitAnnexIndex :: Git.Repo -> FilePath
|
gitAnnexIndex :: Git.Repo -> FilePath
|
||||||
gitAnnexIndex r = gitAnnexDir r </> "index"
|
gitAnnexIndex r = gitAnnexDir r </> "index"
|
||||||
|
|
||||||
{- Lock file for .git/annex/index. Not to be confused with git's
|
{- Holds the ref of the git-annex branch that the index was last updated to.
|
||||||
- index.lock. -}
|
-
|
||||||
gitAnnexIndexLock :: Git.Repo -> FilePath
|
- The .lck in the name is a historical accident; this is not used as a
|
||||||
gitAnnexIndexLock r = gitAnnexDir r </> "index.lck"
|
- lock. -}
|
||||||
|
gitAnnexIndexStatus :: Git.Repo -> FilePath
|
||||||
|
gitAnnexIndexStatus r = gitAnnexDir r </> "index.lck"
|
||||||
|
|
||||||
{- List of refs that should not be merged into the git-annex branch. -}
|
{- List of refs that should not be merged into the git-annex branch. -}
|
||||||
gitAnnexIgnoredRefs :: Git.Repo -> FilePath
|
gitAnnexIgnoredRefs :: Git.Repo -> FilePath
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue