forked from microsoft/VFSForGit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGitEnlistment.cs
More file actions
46 lines (39 loc) · 1.45 KB
/
GitEnlistment.cs
File metadata and controls
46 lines (39 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using GVFS.Common;
using System;
using System.IO;
namespace FastFetch
{
public class GitEnlistment : Enlistment
{
private GitEnlistment(string repoRoot, string gitBinPath)
: base(
repoRoot,
repoRoot,
null,
gitBinPath,
gvfsHooksRoot: null,
flushFileBuffersForPacks: false,
authentication: null)
{
this.GitObjectsRoot = Path.Combine(repoRoot, GVFSConstants.DotGit.Objects.Root);
this.LocalObjectsRoot = this.GitObjectsRoot;
this.GitPackRoot = Path.Combine(this.GitObjectsRoot, GVFSConstants.DotGit.Objects.Pack.Name);
}
public override string GitObjectsRoot { get; protected set; }
public override string LocalObjectsRoot { get; protected set; }
public override string GitPackRoot { get; protected set; }
public string FastFetchLogRoot
{
get { return Path.Combine(this.EnlistmentRoot, GVFSConstants.DotGit.Root, ".fastfetch"); }
}
public static GitEnlistment CreateFromCurrentDirectory(string gitBinPath)
{
string root = Paths.GetGitEnlistmentRoot(Environment.CurrentDirectory);
if (root != null)
{
return new GitEnlistment(root, gitBinPath);
}
return null;
}
}
}