summaryrefslogtreecommitdiff
path: root/Git/Ref.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-04-11 12:45:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-04-11 12:45:49 -0400
commitc924542e61607d725fbfa51ffbf88d825b4d3382 (patch)
treee76c12eec3942efc2c2ab006d5737822bfb500f4 /Git/Ref.hs
parent378f61d0ef5564aab28442f09b2462ce7013ce1b (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/Ref.hs')
-rw-r--r--Git/Ref.hs4
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