Example #1
0
            public static LsTreeEntry ParseFromLsTreeLine(string line)
            {
                if (DiffTreeResult.IsLsTreeLineOfType(line, DiffTreeResult.BlobMarker))
                {
                    LsTreeEntry blobEntry = new LsTreeEntry();
                    blobEntry.Sha      = line.Substring(DiffTreeResult.TypeMarkerStartIndex + DiffTreeResult.BlobMarker.Length, GVFSConstants.ShaStringLength);
                    blobEntry.Filename = GitPathConverter.ConvertPathOctetsToUtf8(line.Substring(line.LastIndexOf("\t") + 1).Trim('"'));

                    return(blobEntry);
                }

                return(null);
            }
Example #2
0
            public static LsTreeEntry ParseFromLsTreeLine(string line)
            {
                int blobIndex = line.IndexOf(GitCatFileProcess.BlobMarker);

                if (blobIndex >= 0)
                {
                    LsTreeEntry blobEntry = new LsTreeEntry();
                    blobEntry.Sha      = line.Substring(blobIndex + GitCatFileProcess.BlobMarker.Length, GVFSConstants.ShaStringLength);
                    blobEntry.Filename = GitPathConverter.ConvertPathOctetsToUtf8(line.Substring(line.LastIndexOf("\t") + 1).Trim('"'));

                    return(blobEntry);
                }

                return(null);
            }
Example #3
0
 public void FilepathWithoutOctetsAsFileAndFolder()
 {
     GitPathConverter.ConvertPathOctetsToUtf8(TestPath + OctetEncoded + TestPath + OctetEncoded + ".txt").ShouldEqual(TestPath + Utf8Encoded + TestPath + Utf8Encoded + ".txt");
 }
Example #4
0
 public void FilepathWithoutOctetsAsFilenameNoExtension()
 {
     GitPathConverter.ConvertPathOctetsToUtf8(TestPath + OctetEncoded + ".txt").ShouldEqual(TestPath + Utf8Encoded + ".txt");
 }
Example #5
0
 public void FilepathWithoutOctetsAsFilename()
 {
     GitPathConverter.ConvertPathOctetsToUtf8(TestPath + OctetEncoded).ShouldEqual(TestPath + Utf8Encoded);
 }
Example #6
0
 public void FilepathWithoutOctets()
 {
     GitPathConverter.ConvertPathOctetsToUtf8(TestPath + "test.cs").ShouldEqual(TestPath + "test.cs");
 }
Example #7
0
 public void EmptyFilepathTest()
 {
     GitPathConverter.ConvertPathOctetsToUtf8(string.Empty).ShouldEqual(string.Empty);
 }
Example #8
0
 public void NullFilepathTest()
 {
     GitPathConverter.ConvertPathOctetsToUtf8(null).ShouldEqual(null);
 }