Esempio n. 1
0
 public Blob(RelativePath filePath)
 {
     FilePath = filePath.GetRelativeToGitRoot();
     FileName = filePath.GetFileName();
     using (StreamReader reader = new StreamReader(filePath.GetAbsolutePath())) {
         FileContent = reader.ReadToEnd();
     }
     _blobContent = CreateBlobFileContent();
     _checksum    = ContentHasher.HashContent(_blobContent);
 }
Esempio n. 2
0
        private void ProcessRestOfIndexFilesAfterCheckout()
        {
            ISet <string> onlyIndexFiles = GetRestOfIndexFiles();

            foreach (string indexFile in onlyIndexFiles)
            {
                RelativePath indexFilePath = new RelativePath(indexFile);

                if (Index.IsCommited(indexFilePath))
                {
                    Index.RemoveFile(indexFilePath);
                    File.Delete(indexFilePath.GetAbsolutePath());
                }
                else if (Index.IsStaged(indexFilePath))
                {
                    Index.SetRepoFileContentKey(indexFilePath, "0");
                }
                else if (Index.IsModified(indexFilePath))
                {
                    Index.SetStageFileContentKey(indexFilePath, "0");
                    Index.SetRepoFileContentKey(indexFilePath, "0");
                }
            }
        }