summaryrefslogtreecommitdiff
path: root/Remote/Hook.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-21 00:34:48 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-21 00:51:42 -0400
commitb3431cb37b5b7aff11ce9a25102bf5446b59a18c (patch)
treeb447b0055ab5dc30951f6fcf443eded468781e03 /Remote/Hook.hs
parent10298ba18f004ccf528ebc3ea4ec8475899fb095 (diff)
!! removal
Diffstat (limited to 'Remote/Hook.hs')
-rw-r--r--Remote/Hook.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Remote/Hook.hs b/Remote/Hook.hs
index 716a81835..f97e110d8 100644
--- a/Remote/Hook.hs
+++ b/Remote/Hook.hs
@@ -69,10 +69,10 @@ hookEnv k f = Just <$> mergeenv (fileenv f ++ keyenv)
M.union (M.fromList l)
<$> M.fromList <$> getEnvironment
env s v = ("ANNEX_" ++ s, v)
- keyenv =
- [ env "KEY" (key2file k)
- , env "HASH_1" (hashbits !! 0)
- , env "HASH_2" (hashbits !! 1)
+ keyenv = catMaybes
+ [ Just $ env "KEY" (key2file k)
+ , env "HASH_1" <$> headMaybe hashbits
+ , env "HASH_2" <$> headMaybe (drop 1 hashbits)
]
fileenv Nothing = []
fileenv (Just file) = [env "FILE" file]