Skip to content

Commit 2258265

Browse files
authored
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.
2 parents 29fd6a1 + 8c366d0 commit 2258265

7 files changed

Lines changed: 9 additions & 8 deletions

File tree

GVFS/GVFS.Common/Enlistment.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public abstract class Enlistment
1010
protected Enlistment(
1111
string enlistmentRoot,
1212
string workingDirectoryRoot,
13-
string localStorageRoot,
13+
string workingDirectoryBackingRoot,
1414
string repoUrl,
1515
string gitBinPath,
1616
string gvfsHooksRoot,
@@ -24,7 +24,7 @@ protected Enlistment(
2424

2525
this.EnlistmentRoot = enlistmentRoot;
2626
this.WorkingDirectoryRoot = workingDirectoryRoot;
27-
this.WorkingDirectoryBackingRoot = localStorageRoot;
27+
this.WorkingDirectoryBackingRoot = workingDirectoryBackingRoot;
2828
this.DotGitRoot = Path.Combine(this.WorkingDirectoryBackingRoot, GVFSConstants.DotGit.Root);
2929
this.GitBinPath = gitBinPath;
3030
this.GVFSHooksRoot = gvfsHooksRoot;

GVFS/GVFS.Common/GVFSEnlistment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public GVFSEnlistment(string enlistmentRoot, string repoUrl, string gitBinPath,
2323
: base(
2424
enlistmentRoot,
2525
Path.Combine(enlistmentRoot, GVFSConstants.WorkingDirectoryRootName),
26-
Path.Combine(enlistmentRoot, GVFSPlatform.Instance.Constants.WorkingDirectoryBackingRootName),
26+
Path.Combine(enlistmentRoot, GVFSPlatform.Instance.Constants.WorkingDirectoryBackingRootPath),
2727
repoUrl,
2828
gitBinPath,
2929
gvfsHooksRoot,

GVFS/GVFS.Common/GVFSPlatform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public abstract class GVFSPlatformConstants
9292
public static readonly char PathSeparator = Path.DirectorySeparatorChar;
9393
public abstract string ExecutableExtension { get; }
9494
public abstract string InstallerExtension { get; }
95-
public abstract string WorkingDirectoryBackingRootName { get; }
95+
public abstract string WorkingDirectoryBackingRootPath { get; }
9696

9797
public abstract string GVFSBinDirectoryPath { get; }
9898

GVFS/GVFS.Platform.Mac/MacPlatform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public override string InstallerExtension
4747
get { return ".dmg"; }
4848
}
4949

50-
public override string WorkingDirectoryBackingRootName
50+
public override string WorkingDirectoryBackingRootPath
5151
{
5252
get { return GVFSConstants.WorkingDirectoryRootName; }
5353
}

GVFS/GVFS.Platform.Windows/WindowsPlatform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ public override string InstallerExtension
406406
get { return ".exe"; }
407407
}
408408

409-
public override string WorkingDirectoryBackingRootName
409+
public override string WorkingDirectoryBackingRootPath
410410
{
411411
get { return GVFSConstants.WorkingDirectoryRootName; }
412412
}

GVFS/GVFS.UnitTests/Mock/Common/MockPlatform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public override string InstallerExtension
165165
get { return ".mockexe"; }
166166
}
167167

168-
public override string WorkingDirectoryBackingRootName
168+
public override string WorkingDirectoryBackingRootPath
169169
{
170170
get { return GVFSConstants.WorkingDirectoryRootName; }
171171
}

GVFS/GVFS/CommandLine/CloneVerb.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ private Result CreateClone(
662662
return new Result(true);
663663
}
664664

665+
// TODO(Linux), TODO(Mac): either adjust to "git" or remove entirely
665666
private void CreateGitScript(GVFSEnlistment enlistment)
666667
{
667668
FileInfo gitCmd = new FileInfo(Path.Combine(enlistment.EnlistmentRoot, "git.cmd"));
@@ -730,4 +731,4 @@ public Result(string errorMessage)
730731
public string ErrorMessage { get; }
731732
}
732733
}
733-
}
734+
}

0 commit comments

Comments
 (0)