Revert "pass --git-dir, rather than changing cwd"
authorJoey Hess <joeyh@joeyh.name>
Fri, 23 Oct 2020 19:51:38 +0000 (15:51 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 23 Oct 2020 20:09:50 +0000 (16:09 -0400)
This reverts commit c142696c587100b195accec4e9bfaa26cde73d48.

It turns out it was not needed; 681313dfd4e840e6366f3c39eddd92f65d764188
fixed up the git dir, so setting cwd to it works ok.

But worst, this commit broke the test suite massively. I don't understand how.
git-annex get was failing. Very weirdly, git-annex find in a fresh
clone of an annex repo, during autoinit, was displaying a side message
-- but side messages are disabled when running find.

Git/Config.hs

index db1bc3c19b4ceeae38acd27cab38287112528aa1..45cf4aa8fb69aa58efe4f8b9171832358cb4d21e 100644 (file)
@@ -61,15 +61,10 @@ read' repo = go repo
        go _ = assertLocal repo $ error "internal"
        git_config d = withCreateProcess p (git_config' p)
          where
-               params =
-                       [ "--git-dir"
-                       , fromRawFilePath d
-                       , "config"
-                       , "--null"
-                       , "--list"
-                       ]
+               params = ["config", "--null", "--list"]
                p = (proc "git" params)
-                       { env = gitEnv repo
+                       { cwd = Just (fromRawFilePath d)
+                       , env = gitEnv repo
                        , std_out = CreatePipe 
                        }
        git_config' p _ (Just hout) _ pid =