diff options
author | Joey Hess <joey@kitenet.net> | 2014-07-03 14:35:20 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-07-03 14:35:20 -0400 |
commit | 4e339e8a4183254b20d621696d69c6ccf08dab5b (patch) | |
tree | c01e8a4e22f4014fa61edf416d7ff3d38d75387a /Annex | |
parent | 58d8c9a36f7971550c1d9d71ff9e30e1325920bc (diff) |
really add non-date metadata too
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/MetaData.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Annex/MetaData.hs b/Annex/MetaData.hs index f1b79e3f4..22e9e7e50 100644 --- a/Annex/MetaData.hs +++ b/Annex/MetaData.hs @@ -7,7 +7,7 @@ module Annex.MetaData ( genMetaData, - addDateMetaData, + dateMetaData, module X ) where @@ -39,14 +39,14 @@ genMetaData key file status = do maybe noop (flip copyMetaData key) =<< catKeyFileHEAD file whenM (annexGenMetaData <$> Annex.getGitConfig) $ do curr <- getCurrentMetaData key - addMetaData key (addDateMetaData mtime curr) + addMetaData key (dateMetaData mtime curr) where mtime = posixSecondsToUTCTime $ realToFrac $ modificationTime status {- Generates metadata for a file's date stamp. - Does not overwrite any existing metadata values. -} -addDateMetaData :: UTCTime -> MetaData -> MetaData -addDateMetaData mtime old = MetaData $ M.fromList $ filter isnew +dateMetaData :: UTCTime -> MetaData -> MetaData +dateMetaData mtime old = MetaData $ M.fromList $ filter isnew [ (yearMetaField, S.singleton $ toMetaValue $ show y) , (monthMetaField, S.singleton $ toMetaValue $ show m) ] |