use NonEmpty for dirHashes

This avoids 4 uses of head.
This commit is contained in:
Joey Hess 2024-09-26 18:15:00 -04:00
parent 43f31121a5
commit 10216b44d2
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 34 additions and 22 deletions

View file

@ -307,7 +307,7 @@ bup2GitRemote r
| otherwise = Git.Construct.fromUrl $ "ssh://" ++ host ++ slash dir
where
bits = splitc ':' r
host = Prelude.head bits
host = fromMaybe "" $ headMaybe bits
dir = intercalate ":" $ drop 1 bits
-- "host:~user/dir" is not supported specially by bup;
-- "host:dir" is relative to the home directory;