Example #1
0
        public void LoadOrCreate()
        {
            foreach (string line in this.sparseCheckoutSerializer.ReadAll())
            {
                string sanitizedFileLine;
                if (GitConfigFileUtils.TrySanitizeConfigFileLine(line, out sanitizedFileLine))
                {
                    this.sparseCheckoutEntries.Add(sanitizedFileLine);
                }
            }

            this.sparseCheckoutSerializer.Close();
        }
Example #2
0
        public void LoadOrCreate()
        {
            foreach (string line in this.fileSerializer.ReadAll())
            {
                string sanitizedFileLine;
                if (GitConfigFileUtils.TrySanitizeConfigFileLine(line, out sanitizedFileLine))
                {
                    this.entries.Add(sanitizedFileLine);
                }
            }

            // Ensure the default entry is always in the exclude file
            if (this.entries.Add(DefaultEntry))
            {
                this.fileSerializer.AppendLine(DefaultEntry);
                this.fileSerializer.Close();
            }
        }