correctness
This commit is contained in:
parent
dc1d5e6831
commit
4fbdb197d5
3 changed files with 9 additions and 7 deletions
6
UUID.hs
6
UUID.hs
|
@ -23,14 +23,16 @@ genUUID :: IO String
|
|||
genUUID = do
|
||||
pOpen ReadFromPipe "uuid" ["-m"] $ \h -> hGetLine h
|
||||
|
||||
{- Looks up a repo's UUID -}
|
||||
getUUID :: GitRepo -> String
|
||||
getUUID repo = gitConfig repo "annex.uuid" ""
|
||||
|
||||
{- Make sure that the repo has an annex.uuid setting. -}
|
||||
prepUUID :: GitRepo -> IO ()
|
||||
prepUUID :: GitRepo -> IO GitRepo
|
||||
prepUUID repo =
|
||||
if ("" == getUUID repo)
|
||||
then do
|
||||
uuid <- genUUID
|
||||
gitRun repo ["config", configkey, uuid]
|
||||
else return ()
|
||||
gitConfigRead repo -- return new repo with updated config
|
||||
else return repo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue