diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-08 15:31:03 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-08 15:39:04 -0400 |
commit | b1915b9054ffa57e84c1300ac0d0d9bc1c7af20d (patch) | |
tree | c4b7771e493a5c8997e04dcf93868e6d5b94fe89 /CmdLine/GitAnnexShell | |
parent | 97f152eff1d9b1c7543844dacda8c264aadede9f (diff) |
Windows: Fix handling of absolute unix-style git repository paths.
Note that on Windows a remote with a path like /home/foo/bar
is interpreted by git as being some screwy relative path (relative to what
exactly seems ill-defined -- it seemed relative to C:\Program Files\Git\ in
my tests!) So no attempt has been made to handle such a path sanely, just not
to crash when encountering it.
Note that "C:\\foo" </> "/home/foo/bar" yields /home/foo/bar even though
that is not absolute! I don't know what to make of all this,
except that I will be very happy when this crock of **** vanishes from
the face of the earth.
Diffstat (limited to 'CmdLine/GitAnnexShell')
-rw-r--r-- | CmdLine/GitAnnexShell/Fields.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/CmdLine/GitAnnexShell/Fields.hs b/CmdLine/GitAnnexShell/Fields.hs index e71f2c2a0..4f208773b 100644 --- a/CmdLine/GitAnnexShell/Fields.hs +++ b/CmdLine/GitAnnexShell/Fields.hs @@ -9,6 +9,7 @@ module CmdLine.GitAnnexShell.Fields where import Common.Annex import qualified Annex +import Git.FilePath import Data.Char @@ -29,7 +30,7 @@ remoteUUID = Field "remoteuuid" $ associatedFile :: Field associatedFile = Field "associatedfile" $ \f -> -- is the file a safe relative filename? - not (isAbsolute f) && not ("../" `isPrefixOf` f) + not (absoluteGitPath f) && not ("../" `isPrefixOf` f) direct :: Field direct = Field "direct" $ \f -> f == "1" |