Esempio n. 1
0
 private void ParsePathForIndexEntry(GitIndexEntry indexEntry, string path, int replaceIndex)
 {
     byte[] pathBuffer = Encoding.ASCII.GetBytes(path);
     Buffer.BlockCopy(pathBuffer, 0, indexEntry.PathBuffer, 0, path.Length);
     indexEntry.PathLength   = path.Length;
     indexEntry.ReplaceIndex = replaceIndex;
     indexEntry.ParsePath();
 }
            private FileSystemTaskResult AddToProjection(GitIndexEntry data)
            {
                if (data.SkipWorktree || data.MergeState == MergeStage.Yours)
                {
                    data.ParsePath();
                    this.projection.AddItemFromIndexEntry(data);
                }
                else
                {
                    data.ClearLastParent();
                }

                return(FileSystemTaskResult.Success);
            }
Esempio n. 3
0
            private FileSystemTaskResult AddToProjection(GitIndexEntry data)
            {
                // Never want to project the common ancestor even if the skip worktree bit is on
                if ((data.MergeState != MergeStage.CommonAncestor && data.SkipWorktree) || data.MergeState == MergeStage.Yours)
                {
                    data.ParsePath();
                    this.projection.AddItemFromIndexEntry(data);
                }
                else
                {
                    data.ClearLastParent();
                }

                return(FileSystemTaskResult.Success);
            }
            private FileSystemTaskResult AddToModifiedFiles(GitIndexEntry data)
            {
                if (!data.SkipWorktree)
                {
                    // A git command (e.g. 'git reset --mixed') may have cleared a file's skip worktree bit without
                    // triggering an update to the projection.  Ensure this file is in GVFS's modified files database
                    data.ParsePath();
                    return(this.projection.AddModifiedPath(data.GetFullPath()));
                }
                else
                {
                    data.ClearLastParent();
                }

                return(FileSystemTaskResult.Success);
            }