summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-02-26 14:15:45 -0400
committerJoey Hess <joey@kitenet.net>2014-02-26 14:15:45 -0400
commitc38a32e5c36ad2998844bcfc601aef5280cd2973 (patch)
tree01cace35b7f5745d482669c5badcebb0837e1839
parent0f78a1c58ba2d4152b5671e0c055ef6f37f44425 (diff)
downloadgit-repair-c38a32e5c36ad2998844bcfc601aef5280cd2973.tar.gz
fix skipping git hooks
-rw-r--r--Git/Destroyer.hs4
1 files 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
]