Beispiel #1
0
        private void TestPathParts(GitIndexEntry indexEntry, string[] pathParts, bool hasSameParent)
        {
            indexEntry.HasSameParentAsLastEntry.ShouldEqual(hasSameParent, nameof(indexEntry.HasSameParentAsLastEntry));
            indexEntry.NumParts.ShouldEqual(pathParts.Length, nameof(indexEntry.NumParts));
            for (int i = 0; i < pathParts.Length; i++)
            {
                indexEntry.PathParts[i].ShouldNotBeNull();
                indexEntry.PathParts[i].GetString().ShouldEqual(pathParts[i]);
            }

            indexEntry.GetChildName().GetString().ShouldEqual(pathParts[pathParts.Length - 1]);
            indexEntry.GetFullPath().ShouldEqual(string.Join("/", pathParts));
        }
            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);
            }