minimize lenth of path to gpg agent socket
Considered using the system tmp dir rather than putting it inside .t/, but then if TEMP were set to a long path, that would be a problem. Relative path seems the best approach, and will always be nice and short. The only downside of it is, if git-annex somehow changes the cwd while running, it would break. But git-annex does not do that, and should never do that.
This commit is contained in:
parent
40c911e427
commit
b426ff6825
2 changed files with 23 additions and 3 deletions
9
Test.hs
9
Test.hs
|
@ -1574,10 +1574,13 @@ test_crypto = do
|
|||
where
|
||||
gpgcmd = Utility.Gpg.mkGpgCmd Nothing
|
||||
testscheme scheme = do
|
||||
gpgtmp <- (</> "gpgtest") <$> absPath tmpdir
|
||||
abstmp <- absPath tmpdir
|
||||
testscheme' scheme abstmp
|
||||
testscheme' scheme abstmp = intmpclonerepo $ whenM (Utility.Path.inPath (Utility.Gpg.unGpgCmd gpgcmd)) $ do
|
||||
-- Use a relative path to avoid too long path to gpg's
|
||||
-- agent socket.
|
||||
gpgtmp <- (</> "gpgtmp") <$> relPathCwdToFile abstmp
|
||||
createDirectoryIfMissing False gpgtmp
|
||||
testscheme' scheme gpgtmp
|
||||
testscheme' scheme gpgtmp = intmpclonerepo $ whenM (Utility.Path.inPath (Utility.Gpg.unGpgCmd gpgcmd)) $ do
|
||||
Utility.Gpg.testTestHarness gpgtmp gpgcmd
|
||||
@? "test harness self-test failed"
|
||||
Utility.Gpg.testHarness gpgtmp gpgcmd $ do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue