summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Backend.hs1
-rw-r--r--TypeInternals.hs10
-rw-r--r--debian/changelog3
3 files changed, 4 insertions, 10 deletions
diff --git a/Backend.hs b/Backend.hs
index 7e88ff304..a417c7247 100644
--- a/Backend.hs
+++ b/Backend.hs
@@ -130,7 +130,6 @@ lookupFile file = do
getsymlink = do
l <- readSymbolicLink file
return $ takeFileName l
- makekey _ [] = return Nothing
makekey bs l = do
case maybeLookupBackendName bs bname of
Nothing -> do
diff --git a/TypeInternals.hs b/TypeInternals.hs
index 12a9080b3..44db743fa 100644
--- a/TypeInternals.hs
+++ b/TypeInternals.hs
@@ -55,7 +55,7 @@ instance Read Key where
readsPrec _ s = [(Key (b,k), "")]
where
l = split ":" s
- b = head l
+ b = if null l then "" else head l
k = join ":" $ drop 1 l
-- for quickcheck
@@ -67,13 +67,9 @@ instance Arbitrary Key where
prop_idempotent_key_read_show :: Key -> Bool
prop_idempotent_key_read_show k
- -- filter out empty key or backend names
- -- also backend names will not contain colons
- | null kname || null bname || elem ':' bname = True
+ -- backend names will never contain colons
+ | elem ':' (backendName k) = True
| otherwise = k == (read $ show k)
- where
- bname = backendName k
- kname = keyName k
backendName :: Key -> BackendName
backendName (Key (b,_)) = b
diff --git a/debian/changelog b/debian/changelog
index 2fd6d9d81..9ae31edc7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,8 +4,7 @@ git-annex (0.17) unstable; urgency=low
it being an error.
* New migrate subcommand can be used to switch files to using a different
backend, safely and with no duplication of content.
- * bugfix: Fix crash caused by a symlink in the repo with link text ending in
- a "/". (Thanks Henrik for reporting.)
+ * bugfix: Fix crash caused by empty key name. (Thanks Henrik for reporting.)
-- Joey Hess <joeyh@debian.org> Sun, 09 Jan 2011 10:04:11 -0400