avoid using dropWhileEnd

That needs bytestring-0.11.1.0 and several builds don't have that.
This commit is contained in:
Joey Hess 2024-05-28 10:27:36 -04:00
parent c6669990fb
commit a52d5cc903
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -105,14 +105,14 @@ isGitRemoteAnnexKey u k =
case fromKey keyVariety k of
GitBundleKey -> sameuuid $ \b ->
-- Remove the checksum that comes after the UUID.
let b' = B8.dropWhileEnd (/= '-') b
let b' = fst $ B8.spanEnd (/= '-') b
in B8.take (B8.length b' - 1) b'
GitManifestKey -> sameuuid $ \b ->
-- Remove an optional extension after the UUID.
-- (A UUID never contains '.')
if '.' `B8.elem` b
then
let b' = B8.dropWhileEnd (/= '.') b
let b' = fst $ B8.spanEnd (/= '.') b
in B8.take (B8.length b' - 1) b'
else b
_ -> False