Merge pull request #1119 from github/rename-workdir-backing-path

Rename WorkingDirectoryBackingRootPath constants

This PR primarily is a followup to #1102 to accommodate the fact that
on Linux, the relative location of the working directory backing store
will be a short path (i.e., ".gvfs/lower") and not a single filename like "src".
Hence we rename the WorkingDirectoryBackingRootName constants to
WorkingDirectoryBackingRootPath, akin to how other short relative path
constants are constructed in GVFS.Common.GVFSConstants.DotGVFS.

We also fix up the internal name of the workingDirectoryBackingRoot
argument to the GVFS.Common.Enlistment class, and add a TODO comment
regarding the git.cmd script, which is unused on non-Windows platforms.
This commit is contained in:
Chris Darroch 2019-05-09 14:29:40 -07:00 коммит произвёл GitHub
Родитель 29fd6a1746 8c366d04c3
Коммит 22582651bf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -10,7 +10,7 @@ namespace GVFS.Common
protected Enlistment(
string enlistmentRoot,
string workingDirectoryRoot,
string localStorageRoot,
string workingDirectoryBackingRoot,
string repoUrl,
string gitBinPath,
string gvfsHooksRoot,
@ -24,7 +24,7 @@ namespace GVFS.Common
this.EnlistmentRoot = enlistmentRoot;
this.WorkingDirectoryRoot = workingDirectoryRoot;
this.WorkingDirectoryBackingRoot = localStorageRoot;
this.WorkingDirectoryBackingRoot = workingDirectoryBackingRoot;
this.DotGitRoot = Path.Combine(this.WorkingDirectoryBackingRoot, GVFSConstants.DotGit.Root);
this.GitBinPath = gitBinPath;
this.GVFSHooksRoot = gvfsHooksRoot;

Просмотреть файл

@ -23,7 +23,7 @@ namespace GVFS.Common
: base(
enlistmentRoot,
Path.Combine(enlistmentRoot, GVFSConstants.WorkingDirectoryRootName),
Path.Combine(enlistmentRoot, GVFSPlatform.Instance.Constants.WorkingDirectoryBackingRootName),
Path.Combine(enlistmentRoot, GVFSPlatform.Instance.Constants.WorkingDirectoryBackingRootPath),
repoUrl,
gitBinPath,
gvfsHooksRoot,

Просмотреть файл

@ -92,7 +92,7 @@ namespace GVFS.Common
public static readonly char PathSeparator = Path.DirectorySeparatorChar;
public abstract string ExecutableExtension { get; }
public abstract string InstallerExtension { get; }
public abstract string WorkingDirectoryBackingRootName { get; }
public abstract string WorkingDirectoryBackingRootPath { get; }
public abstract string GVFSBinDirectoryPath { get; }

Просмотреть файл

@ -47,7 +47,7 @@ namespace GVFS.Platform.Mac
get { return ".dmg"; }
}
public override string WorkingDirectoryBackingRootName
public override string WorkingDirectoryBackingRootPath
{
get { return GVFSConstants.WorkingDirectoryRootName; }
}

Просмотреть файл

@ -406,7 +406,7 @@ namespace GVFS.Platform.Windows
get { return ".exe"; }
}
public override string WorkingDirectoryBackingRootName
public override string WorkingDirectoryBackingRootPath
{
get { return GVFSConstants.WorkingDirectoryRootName; }
}

Просмотреть файл

@ -165,7 +165,7 @@ namespace GVFS.UnitTests.Mock.Common
get { return ".mockexe"; }
}
public override string WorkingDirectoryBackingRootName
public override string WorkingDirectoryBackingRootPath
{
get { return GVFSConstants.WorkingDirectoryRootName; }
}

Просмотреть файл

@ -662,6 +662,7 @@ namespace GVFS.CommandLine
return new Result(true);
}
// TODO(Linux), TODO(Mac): either adjust to "git" or remove entirely
private void CreateGitScript(GVFSEnlistment enlistment)
{
FileInfo gitCmd = new FileInfo(Path.Combine(enlistment.EnlistmentRoot, "git.cmd"));
@ -730,4 +731,4 @@ git %*
public string ErrorMessage { get; }
}
}
}
}