summaryrefslogtreecommitdiff
path: root/Logs/Location.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-10-12 14:46:28 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-10-12 14:46:47 -0400
commitdb92795125fd5d9df3b1cf50f92c1e046645f8bf (patch)
treee5832b6e06ab04946a176129ed3a0a78c1a60577 /Logs/Location.hs
parent5abc2da9d1f4f6043370158fb1c0569eccf29941 (diff)
Avoid unncessary write to the location log when a file is unlocked and then added back with unchanged content.
Implemented with no additional overhead of compares etc. This is safe to do for presence logs because of their locality of change; a given repo's presence logs are only ever changed in that repo, or in a repo that has just been actively changing the content of that repo. So, we don't need to worry about a split-brain situation where there'd be disagreement about the location of a key in a repo. And so, it's ok to not update the timestamp when that's the only change that would be made due to logging presence info.
Diffstat (limited to 'Logs/Location.hs')
-rw-r--r--Logs/Location.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Logs/Location.hs b/Logs/Location.hs
index ba9c31abf..89100805b 100644
--- a/Logs/Location.hs
+++ b/Logs/Location.hs
@@ -48,7 +48,7 @@ logChange = logChange' logNow
logChange' :: (LogStatus -> String -> Annex LogLine) -> Key -> UUID -> LogStatus -> Annex ()
logChange' mklog key (UUID u) s = do
config <- Annex.getGitConfig
- addLog (locationLogFile config key) =<< mklog s u
+ maybeAddLog (locationLogFile config key) =<< mklog s u
logChange' _ _ NoUUID _ = noop
{- Returns a list of repository UUIDs that, according to the log, have