metadata: FIeld names are now case insensative.

This commit is contained in:
Joey Hess 2014-02-25 18:45:09 -04:00
parent 6272c10818
commit 06e9080f01
9 changed files with 33 additions and 32 deletions

View file

@ -20,13 +20,13 @@ import Data.Time.Clock
import Data.Time.Clock.POSIX
tagMetaField :: MetaField
tagMetaField = MetaField "tag"
tagMetaField = mkMetaFieldUnchecked "tag"
yearMetaField :: MetaField
yearMetaField = MetaField "year"
yearMetaField = mkMetaFieldUnchecked "year"
monthMetaField :: MetaField
monthMetaField = MetaField "month"
monthMetaField = mkMetaFieldUnchecked "month"
{- Adds metadata for a file that has just been ingested into the
- annex, but has not yet been committed to git.

View file

@ -249,7 +249,7 @@ getDirMetaData :: FilePath -> MetaData
getDirMetaData d = MetaData $ M.fromList $ zip fields values
where
dirs = splitDirectories d
fields = map (MetaField . addTrailingPathSeparator . joinPath)
fields = map (mkMetaFieldUnchecked . addTrailingPathSeparator . joinPath)
(inits dirs)
values = map (S.singleton . toMetaValue . fromMaybe "" . headMaybe)
(tails dirs)