diff options
author | Joey Hess <joey@kitenet.net> | 2012-04-11 12:45:05 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-04-11 12:45:49 -0400 |
commit | c924542e61607d725fbfa51ffbf88d825b4d3382 (patch) | |
tree | e76c12eec3942efc2c2ab006d5737822bfb500f4 /Git | |
parent | 378f61d0ef5564aab28442f09b2462ce7013ce1b (diff) |
bup: Properly handle key names with spaces or other things that are not legal git refs.
Continue using the key name as bup ref name, to preserve backwards
compatability, unless it is an illegal git ref. In that case, use a sha256
of the key name instead.
Diffstat (limited to 'Git')
-rw-r--r-- | Git/Ref.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Git/Ref.hs b/Git/Ref.hs index 29b69de9b..ee2f02187 100644 --- a/Git/Ref.hs +++ b/Git/Ref.hs @@ -67,8 +67,8 @@ matchingUniq ref repo = nubBy uniqref <$> matching ref repo {- Checks if a String is a legal git ref name. - - The rules for this are complex; see git-check-ref-format(1) -} -legalRef :: Bool -> String -> Bool -legalRef allowonelevel s = all (== False) illegal +legal :: Bool -> String -> Bool +legal allowonelevel s = all (== False) illegal where illegal = [ any ("." `isPrefixOf`) pathbits |