Fix bug that caused bad information to be written to the git-annex branch when running describe or other commands with a remote that has no uuid.
Still need to fix crash caused by the bad info.
This commit is contained in:
parent
f3c714293a
commit
46cf00ffd8
2 changed files with 15 additions and 7 deletions
20
Remote.hs
20
Remote.hs
|
@ -90,11 +90,12 @@ byNameWithUUID = checkuuid <=< byName
|
||||||
where
|
where
|
||||||
checkuuid Nothing = return Nothing
|
checkuuid Nothing = return Nothing
|
||||||
checkuuid (Just r)
|
checkuuid (Just r)
|
||||||
| uuid r == NoUUID = do
|
| uuid r == NoUUID =
|
||||||
let e = "cannot determine uuid for " ++ name r
|
|
||||||
if remoteAnnexIgnore (gitconfig r)
|
if remoteAnnexIgnore (gitconfig r)
|
||||||
then error $ e ++ " (" ++ show (remoteConfig (repo r) "ignore") ++ " is set)"
|
then error $ noRemoteUUIDMsg r ++
|
||||||
else error e
|
" (" ++ show (remoteConfig (repo r) "ignore") ++
|
||||||
|
" is set)"
|
||||||
|
else error $ noRemoteUUIDMsg r
|
||||||
| otherwise = return $ Just r
|
| otherwise = return $ Just r
|
||||||
|
|
||||||
byName' :: RemoteName -> Annex (Either String Remote)
|
byName' :: RemoteName -> Annex (Either String Remote)
|
||||||
|
@ -111,16 +112,21 @@ byNameOnly n = headMaybe . filter matching <$> remoteList
|
||||||
where
|
where
|
||||||
matching r = n == name r
|
matching r = n == name r
|
||||||
|
|
||||||
|
noRemoteUUIDMsg :: Remote -> String
|
||||||
|
noRemoteUUIDMsg r = "cannot determine uuid for " ++ name r
|
||||||
|
|
||||||
{- Looks up a remote by name (or by UUID, or even by description),
|
{- Looks up a remote by name (or by UUID, or even by description),
|
||||||
- and returns its UUID. Finds even remotes that are not configured in
|
- and returns its UUID. Finds even repositories that are not
|
||||||
- .git/config. -}
|
- configured in .git/config. -}
|
||||||
nameToUUID :: RemoteName -> Annex UUID
|
nameToUUID :: RemoteName -> Annex UUID
|
||||||
nameToUUID "." = getUUID -- special case for current repo
|
nameToUUID "." = getUUID -- special case for current repo
|
||||||
nameToUUID "here" = getUUID
|
nameToUUID "here" = getUUID
|
||||||
nameToUUID "" = error "no remote specified"
|
nameToUUID "" = error "no remote specified"
|
||||||
nameToUUID n = byName' n >>= go
|
nameToUUID n = byName' n >>= go
|
||||||
where
|
where
|
||||||
go (Right r) = return $ uuid r
|
go (Right r) = case uuid r of
|
||||||
|
NoUUID -> error $ noRemoteUUIDMsg r
|
||||||
|
u -> return u
|
||||||
go (Left e) = fromMaybe (error e) <$> bydescription
|
go (Left e) = fromMaybe (error e) <$> bydescription
|
||||||
bydescription = do
|
bydescription = do
|
||||||
m <- uuidMap
|
m <- uuidMap
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -22,6 +22,8 @@ git-annex (5.20131102) UNRELEASED; urgency=low
|
||||||
* Include ssh-keygen in standalone bundle.
|
* Include ssh-keygen in standalone bundle.
|
||||||
* Allow optionally configuring git-annex with -fEKG to enable awesome
|
* Allow optionally configuring git-annex with -fEKG to enable awesome
|
||||||
remote monitoring interfaceat http://localhost:4242/
|
remote monitoring interfaceat http://localhost:4242/
|
||||||
|
* Fix bug that caused bad information to be written to the git-annex branch
|
||||||
|
when running describe or other commands with a remote that has no uuid.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Wed, 06 Nov 2013 16:14:14 -0400
|
-- Joey Hess <joeyh@debian.org> Wed, 06 Nov 2013 16:14:14 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue