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); }
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); }
public void FilepathWithoutOctetsAsFileAndFolder() { GitPathConverter.ConvertPathOctetsToUtf8(TestPath + OctetEncoded + TestPath + OctetEncoded + ".txt").ShouldEqual(TestPath + Utf8Encoded + TestPath + Utf8Encoded + ".txt"); }
public void FilepathWithoutOctetsAsFilenameNoExtension() { GitPathConverter.ConvertPathOctetsToUtf8(TestPath + OctetEncoded + ".txt").ShouldEqual(TestPath + Utf8Encoded + ".txt"); }
public void FilepathWithoutOctetsAsFilename() { GitPathConverter.ConvertPathOctetsToUtf8(TestPath + OctetEncoded).ShouldEqual(TestPath + Utf8Encoded); }
public void FilepathWithoutOctets() { GitPathConverter.ConvertPathOctetsToUtf8(TestPath + "test.cs").ShouldEqual(TestPath + "test.cs"); }
public void EmptyFilepathTest() { GitPathConverter.ConvertPathOctetsToUtf8(string.Empty).ShouldEqual(string.Empty); }
public void NullFilepathTest() { GitPathConverter.ConvertPathOctetsToUtf8(null).ShouldEqual(null); }