aboutsummaryrefslogtreecommitdiff
path: root/Annex/Ssh.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-02-28 17:23:13 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-02-28 17:23:13 -0400
commit849a4b1a0d71071a602f552125fd7e25689662db (patch)
tree0b78308f8616c4920d1d109c5afe00bf52492595 /Annex/Ssh.hs
parenta35208c5df555006431a66436288ce156af4fdb9 (diff)
When re-execing git-annex, use current program location, rather than ~/.config/git-annex/program, when possible.
Most of the time, there will be no discreprancy between programPath and readProgramFile. But, the programFile might have been written by an old version of git-annex that is still installed, while a newer one is currently running. In this case, we want to run the same one that's currently running. This is especially important for things like the GIT_SSH=git-annex used for ssh connection caching. The only code that still uses readProgramFile directly is the upgrade code, which needs to know where the standalone git-annex was installed, in order to upgrade it.
Diffstat (limited to 'Annex/Ssh.hs')
-rw-r--r--Annex/Ssh.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs
index 54c54d79f..cd28d1fc0 100644
--- a/Annex/Ssh.hs
+++ b/Annex/Ssh.hs
@@ -31,7 +31,7 @@ import qualified Annex
import qualified Git
import qualified Git.Url
import Config
-import Config.Files
+import Annex.Path
import Utility.Env
import Types.CleanupActions
import Annex.Index (addGitEnv)
@@ -273,7 +273,7 @@ sshOptionsTo remote gc g
case msockfile of
Nothing -> return g
Just sockfile -> do
- command <- liftIO readProgramFile
+ command <- liftIO programPath
prepSocket sockfile
let val = toSshOptionsEnv $ concat
[ sshConnectionCachingParams sockfile