From c38a32e5c36ad2998844bcfc601aef5280cd2973 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 26 Feb 2014 14:15:45 -0400 Subject: fix skipping git hooks --- Git/Destroyer.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Git/Destroyer.hs b/Git/Destroyer.hs index 955e313..06a8b4f 100644 --- a/Git/Destroyer.hs +++ b/Git/Destroyer.hs @@ -83,7 +83,7 @@ generateDamage = sample' (arbitrary :: Gen Damage) - (as long as the Repo contains the same files each time). -} applyDamage :: [Damage] -> Repo -> IO () applyDamage ds r = do - contents <- sort . filter (not . skipped . takeFileName) + contents <- sort . filter (not . skipped) <$> dirContentsRecursive (localGitDir r) forM_ ds $ \d -> do let withfile s a = do @@ -141,7 +141,7 @@ applyDamage ds r = do -- A broken .git/config is not recoverable. -- Don't damage hook scripts, to avoid running arbitrary code. ;) skipped f = or - [ f == "config" + [ takeFileName f == "config" , "hooks" `isPrefixOf` f ] -- cgit v1.2.3