From 1e6b79bdec608948560b0b3221aa6b23436be1bf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 14 Oct 2013 15:05:10 -0400 Subject: fix remote fsck to run in remote --- Remote/Git.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Remote') diff --git a/Remote/Git.hs b/Remote/Git.hs index a3ece1443..480d4f714 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -42,6 +42,7 @@ import Utility.Metered #ifndef mingw32_HOST_OS import Utility.CopyFile #endif +import Utility.Env import Utility.Batch import Remote.Helper.Git import Remote.Helper.Messages @@ -410,7 +411,13 @@ fsckOnRemote r params Just (c, ps) -> batchCommand c ps | otherwise = return $ do program <- readProgramFile - batchCommand program $ Param "fsck" : params + env <- getEnvironment + r' <- Git.Config.read r + let env' = + [ ("GIT_WORK_TREE", Git.repoPath r') + , ("GIT_DIR", Git.localGitDir r') + ] ++ env + batchCommandEnv program (Param "fsck" : params) (Just env') {- Runs an action on a local repository inexpensively, by making an annex - monad using that repository. -} -- cgit v1.2.3