diff options
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/UUID.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Annex/UUID.hs b/Annex/UUID.hs index 7776b778a..cdd06c9e6 100644 --- a/Annex/UUID.hs +++ b/Annex/UUID.hs @@ -15,6 +15,7 @@ module Annex.UUID ( getUUID, getRepoUUID, getUncachedUUID, + isUUIDConfigured, prepUUID, genUUID, genUUIDInNameSpace, @@ -84,6 +85,13 @@ getUncachedUUID = toUUID . Git.Config.get key "" where (ConfigKey key) = configkey +-- Does the repo's config have a key for the UUID? +-- True even when the key has no value. +isUUIDConfigured :: Git.Repo -> Bool +isUUIDConfigured = isJust . Git.Config.getMaybe key + where + (ConfigKey key) = configkey + {- Make sure that the repo has an annex.uuid setting. -} prepUUID :: Annex () prepUUID = whenM ((==) NoUUID <$> getUUID) $ |