Use LibGit2Sharp.Mode in place of strings.

This commit is contained in:
Matt Burke
2014-01-17 15:33:03 -05:00
parent f0c34b4521
commit 71da5daed2
3 changed files with 6 additions and 11 deletions
+2 -2
View File
@@ -24,9 +24,9 @@ namespace Sep.Git.Tfs.Core
_objectDatabase = objectDatabase;
}
public void Add(string path, string file, string mode)
public void Add(string path, string file, LibGit2Sharp.Mode mode)
{
_treeDefinition.Add(path, file, Mode.ToFileMode(mode));
_treeDefinition.Add(path, file, mode);
}
public void Remove(string path)
+2 -7
View File
@@ -1,13 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Sep.Git.Tfs.Core
namespace Sep.Git.Tfs.Core
{
public interface IGitTreeBuilder
{
void Add(string path, string file, string mode);
void Add(string path, string file, LibGit2Sharp.Mode mode);
void Remove(string path);
string GetTree();
}
+2 -2
View File
@@ -57,7 +57,7 @@ namespace Sep.Git.Tfs.Core
private void Update(ApplicableChange change, IGitTreeBuilder treeBuilder, ITfsWorkspace workspace, IDictionary<string, GitObject> initialTree)
{
treeBuilder.Add(change.GitPath, workspace.GetLocalPath(change.GitPath), change.Mode.ToModeString());
treeBuilder.Add(change.GitPath, workspace.GetLocalPath(change.GitPath), change.Mode);
}
public IEnumerable<TfsTreeEntry> GetTree()
@@ -126,7 +126,7 @@ namespace Sep.Git.Tfs.Core
{
if (item.DeletionId == 0)
{
treeBuilder.Add(pathInGitRepo, workspace.GetLocalPath(pathInGitRepo), Mode.NewFile);
treeBuilder.Add(pathInGitRepo, workspace.GetLocalPath(pathInGitRepo), LibGit2Sharp.Mode.NonExecutableFile);
}
}