fix fastDebug to check if debugging is actually enabled

Had to add to AnnexRead an indication of whether debugging is enabled.

Could have just made setupConsole not install a debug output action that
outputs, and have enableDebug be what installs that, but then in the
common case where there is no debug selector, and so all debug output is
selected, it would run the debug output action every time, which entails
an IORef access. Which would make fastDebug too slow..
This commit is contained in:
Joey Hess 2021-04-06 16:28:37 -04:00
parent 13c090b37a
commit 2e9d4ac754
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 19 additions and 14 deletions

View file

@ -59,7 +59,7 @@ git_annex_shell cs r command params fields
dir = Git.repoPath r
shellcmd = "git-annex-shell"
getshellopts = do
debugenabled <- annexDebug <$> Annex.getGitConfig
debugenabled <- Annex.getRead Annex.debugenabled
let params' = if debugenabled
then Param "--debug" : params
else params