예제 #1
0
        private void Update(ApplicableChange change, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary <string, GitObject> initialTree)
        {
            // Assume we cut path at the start, so add it back
            var tfsPath = change.GitPath;

            if (!string.IsNullOrEmpty(_cutPath))
            {
                tfsPath = _cutPath + "/" + tfsPath;
            }

            var localPath = workspace.GetLocalPath(tfsPath);

            if (File.Exists(localPath))
            {
                treeBuilder.Add(change.GitPath, localPath, change.Mode);
            }
            else
            {
                // Fallback to supplied path
                tfsPath   = change.GitPath;
                localPath = workspace.GetLocalPath(tfsPath);
                if (File.Exists(localPath))
                {
                    treeBuilder.Add(change.GitPath, localPath, change.Mode);
                }
                else
                {
                    Trace.TraceInformation("Cannot checkout file '{0}' from TFS. Skip it", tfsPath);
                }
            }
        }
예제 #2
0
 private void Add(IItem item, string pathInGitRepo, IGitTreeModifier treeBuilder, ITfsWorkspace workspace)
 {
     if (item.DeletionId == 0)
     {
         treeBuilder.Add(pathInGitRepo, workspace.GetLocalPath(pathInGitRepo), LibGit2Sharp.Mode.NonExecutableFile);
     }
 }
예제 #3
0
 private void Update(ApplicableChange change, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary<string, GitObject> initialTree)
 {
     var localPath = workspace.GetLocalPath(change.GitPath);
     if (File.Exists(localPath))
     {
         treeBuilder.Add(change.GitPath, localPath, change.Mode);
     }
     else
     {
         _stdout.WriteLine("Cannot checkout file '{0}' from TFS. Skip it", change.GitPath);
     }
 }
예제 #4
0
        private void Update(ApplicableChange change, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary <string, GitObject> initialTree)
        {
            var localPath = workspace.GetLocalPath(change.GitPath);

            if (File.Exists(localPath))
            {
                treeBuilder.Add(change.GitPath, localPath, change.Mode);
            }
            else
            {
                Trace.TraceInformation("Cannot checkout file '{0}' from TFS. Skip it", change.GitPath);
            }
        }
예제 #5
0
        private void Update(ApplicableChange change, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary <string, GitObject> initialTree)
        {
            var localPath = workspace.GetLocalPath(change.GitPath);

            if (File.Exists(localPath))
            {
                if (new System.IO.FileInfo(localPath).Length > 50 * 1024 * 1024)
                {
                    throw new Exception($"File too large for github {localPath}");
                }

                treeBuilder.Add(change.GitPath, localPath, change.Mode);
            }
            else
            {
                Trace.TraceInformation("Cannot checkout file '{0}' from TFS. Skip it", change.GitPath);
            }
        }
예제 #6
0
 private void Add(IItem item, string pathInGitRepo, IGitTreeModifier treeBuilder, ITfsWorkspace workspace)
 {
     if (item.DeletionId == 0)
     {
         treeBuilder.Add(pathInGitRepo, workspace.GetLocalPath(pathInGitRepo), LibGit2Sharp.Mode.NonExecutableFile);
     }
 }
예제 #7
0
 private void Update(ApplicableChange change, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary<string, GitObject> initialTree)
 {
     treeBuilder.Add(change.GitPath, workspace.GetLocalPath(change.GitPath), change.Mode);
 }
예제 #8
0
 private void Update(ApplicableChange change, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary <string, GitObject> initialTree)
 {
     treeBuilder.Add(change.GitPath, workspace.GetLocalPath(change.GitPath), change.Mode);
 }