debug output of git security check probe
authorJoey Hess <joeyh@joeyh.name>
Tue, 31 May 2022 16:25:11 +0000 (12:25 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 31 May 2022 16:25:11 +0000 (12:25 -0400)
This is so, if there's some other failure that triggers it, --debug will
show what went wrong. See https://github.com/datalad/datalad/issues/6708

Sponsored-by: Dartmouth College's Datalad project
Git/Config.hs

index 8021ffc8bb35d6cf706b80ff42e49465eaf00650..7fd096d1f869db6db5e91e04c820002e50da8dab 100644 (file)
@@ -23,6 +23,7 @@ import qualified Git.Command
 import qualified Git.Construct
 import Utility.UserInfo
 import Utility.Process.Transcript
+import Utility.Debug
 
 {- Returns a single git config setting, or a fallback value if not set. -}
 get :: ConfigKey -> ConfigValue -> Repo -> ConfigValue
@@ -288,5 +289,9 @@ checkRepoConfigInaccessible r = do
                { cwd = Just (fromRawFilePath (repoPath r))
                , env = gitEnv r
                }
-       (_out, ok) <- processTranscript' p Nothing
-       return (not ok)
+       (out, ok) <- processTranscript' p Nothing
+       if not ok
+               then do
+                       debug (DebugSource "Git.Config") ("config output: " ++ out)
+                       return True
+               else return False