summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Remote.hs20
-rw-r--r--debian/changelog2
2 files changed, 15 insertions, 7 deletions
diff --git a/Remote.hs b/Remote.hs
index 56a40c71e..e355b0975 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -90,11 +90,12 @@ byNameWithUUID = checkuuid <=< byName
where
checkuuid Nothing = return Nothing
checkuuid (Just r)
- | uuid r == NoUUID = do
- let e = "cannot determine uuid for " ++ name r
+ | uuid r == NoUUID =
if remoteAnnexIgnore (gitconfig r)
- then error $ e ++ " (" ++ show (remoteConfig (repo r) "ignore") ++ " is set)"
- else error e
+ then error $ noRemoteUUIDMsg r ++
+ " (" ++ show (remoteConfig (repo r) "ignore") ++
+ " is set)"
+ else error $ noRemoteUUIDMsg r
| otherwise = return $ Just r
byName' :: RemoteName -> Annex (Either String Remote)
@@ -111,16 +112,21 @@ byNameOnly n = headMaybe . filter matching <$> remoteList
where
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),
- - and returns its UUID. Finds even remotes that are not configured in
- - .git/config. -}
+ - and returns its UUID. Finds even repositories that are not
+ - configured in .git/config. -}
nameToUUID :: RemoteName -> Annex UUID
nameToUUID "." = getUUID -- special case for current repo
nameToUUID "here" = getUUID
nameToUUID "" = error "no remote specified"
nameToUUID n = byName' n >>= go
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
bydescription = do
m <- uuidMap
diff --git a/debian/changelog b/debian/changelog
index 04f015377..bdc7c5e68 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,6 +22,8 @@ git-annex (5.20131102) UNRELEASED; urgency=low
* Include ssh-keygen in standalone bundle.
* Allow optionally configuring git-annex with -fEKG to enable awesome
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