From 71da5daed2e39dd51e7fe64a3f87e0ce70101e52 Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Fri, 17 Jan 2014 15:33:03 -0500 Subject: [PATCH] Use LibGit2Sharp.Mode in place of strings. --- GitTfs/Core/GitTreeBuilder.cs | 4 ++-- GitTfs/Core/IGitTreeBuilder.cs | 9 ++------- GitTfs/Core/TfsChangeset.cs | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/GitTfs/Core/GitTreeBuilder.cs b/GitTfs/Core/GitTreeBuilder.cs index 606d9049..ede9ad37 100644 --- a/GitTfs/Core/GitTreeBuilder.cs +++ b/GitTfs/Core/GitTreeBuilder.cs @@ -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) diff --git a/GitTfs/Core/IGitTreeBuilder.cs b/GitTfs/Core/IGitTreeBuilder.cs index 65f882bf..1e8fd334 100644 --- a/GitTfs/Core/IGitTreeBuilder.cs +++ b/GitTfs/Core/IGitTreeBuilder.cs @@ -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(); } diff --git a/GitTfs/Core/TfsChangeset.cs b/GitTfs/Core/TfsChangeset.cs index ec73996f..332c655e 100644 --- a/GitTfs/Core/TfsChangeset.cs +++ b/GitTfs/Core/TfsChangeset.cs @@ -57,7 +57,7 @@ namespace Sep.Git.Tfs.Core private void Update(ApplicableChange change, IGitTreeBuilder treeBuilder, ITfsWorkspace workspace, IDictionary initialTree) { - treeBuilder.Add(change.GitPath, workspace.GetLocalPath(change.GitPath), change.Mode.ToModeString()); + treeBuilder.Add(change.GitPath, workspace.GetLocalPath(change.GitPath), change.Mode); } public IEnumerable 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); } }