3a66cd715f
When a git remote is configured with an absolute path, use that path, rather than making it relative. If it's configured with a relative path, use that. Git.Construct.fromPath changed to preserve the path as-is, rather than making it absolute. And Annex.new changed to not convert the path to relative. Instead, Git.CurrentRepo.get generates a relative path. A few things that used fromAbsPath unncessarily were changed in passing to use fromPath instead. I'm seeing fromAbsPath as a security check, while before it was being used in some cases when the path was known absolute already. It may be that fromAbsPath is not really needed, but only git-annex-shell uses it now, and I'm not 100% sure that there's not some input that would cause a relative path to be used, opening a security hole, without the security check. So left it as-is. Test suite passes and strace shows the configured remote url is used unchanged in the path into it. I can't be 100% sure there's not some code somewhere that takes an absolute path to the repo and converts it to relative and uses it, but it seems pretty unlikely that the code paths used for a git remote would call such code. One place I know of is gitAnnexLink, but I'm pretty sure that git remotes never deal with annex symlinks. If that did get called, it generates a path relative to cwd, which would have been wrong before this change as well, when operating on a remote. |
||
---|---|---|
.. | ||
Command | ||
Remote | ||
AutoCorrect.hs | ||
Branch.hs | ||
BuildVersion.hs | ||
CatFile.hs | ||
CheckAttr.hs | ||
CheckIgnore.hs | ||
Command.hs | ||
Config.hs | ||
ConfigTypes.hs | ||
Construct.hs | ||
Credential.hs | ||
CurrentRepo.hs | ||
DiffTree.hs | ||
DiffTreeItem.hs | ||
Env.hs | ||
FileMode.hs | ||
Filename.hs | ||
FilePath.hs | ||
Fsck.hs | ||
GCrypt.hs | ||
HashObject.hs | ||
History.hs | ||
Hook.hs | ||
Index.hs | ||
LockFile.hs | ||
LsFiles.hs | ||
LsTree.hs | ||
Merge.hs | ||
Objects.hs | ||
Queue.hs | ||
Ref.hs | ||
RefLog.hs | ||
Remote.hs | ||
Repair.hs | ||
Sha.hs | ||
Ssh.hs | ||
Status.hs | ||
Tree.hs | ||
Types.hs | ||
UnionMerge.hs | ||
UpdateIndex.hs | ||
Url.hs | ||
Version.hs |