示例#1
0
 //
 // IMPORTANT! These must parallel the settings in GSDVerb:TrySetRequiredGitConfigSettings
 //
 public void Initialize()
 {
     Directory.CreateDirectory(this.RootPath);
     GitProcess.Invoke(this.RootPath, "init");
     GitProcess.Invoke(this.RootPath, "config core.autocrlf false");
     GitProcess.Invoke(this.RootPath, "config merge.stat false");
     GitProcess.Invoke(this.RootPath, "config merge.renames false");
     GitProcess.Invoke(this.RootPath, "config advice.statusUoption false");
     GitProcess.Invoke(this.RootPath, "config core.abbrev 40");
     GitProcess.Invoke(this.RootPath, "config pack.useSparse true");
     GitProcess.Invoke(this.RootPath, "config reset.quiet true");
     GitProcess.Invoke(this.RootPath, "config status.aheadbehind false");
     GitProcess.Invoke(this.RootPath, "config user.name \"Functional Test User\"");
     GitProcess.Invoke(this.RootPath, "config user.email \"[email protected]\"");
     GitProcess.Invoke(this.RootPath, "remote add origin " + CachePath);
     this.Fetch(this.Commitish);
     GitProcess.Invoke(this.RootPath, "branch --set-upstream " + this.Commitish + " origin/" + this.Commitish);
     GitProcess.Invoke(this.RootPath, "checkout " + this.Commitish);
     GitProcess.Invoke(this.RootPath, "branch --unset-upstream");
 }
示例#2
0
        public void CloneAndMount(bool skipPrefetch)
        {
            this.gsdProcess.Clone(this.RepoUrl, this.Commitish, skipPrefetch);

            GitProcess.Invoke(this.RepoRoot, "checkout " + this.Commitish);
            GitProcess.Invoke(this.RepoRoot, "branch --unset-upstream");
            GitProcess.Invoke(this.RepoRoot, "config core.abbrev 40");
            GitProcess.Invoke(this.RepoRoot, "config user.name \"Functional Test User\"");
            GitProcess.Invoke(this.RepoRoot, "config user.email \"[email protected]\"");

            // If this repository has a .gitignore file in the root directory, force it to be
            // hydrated. This is because if the GitStatusCache feature is enabled, it will run
            // a "git status" command asynchronously, which will hydrate the .gitignore file
            // as it reads the ignore rules. Hydrate this file here so that it is consistently
            // hydrated and there are no race conditions depending on when / if it is hydrated
            // as part of an asynchronous status scan to rebuild the GitStatusCache.
            string rootGitIgnorePath = Path.Combine(this.RepoRoot, ".gitignore");

            if (File.Exists(rootGitIgnorePath))
            {
                File.ReadAllBytes(rootGitIgnorePath);
            }
        }
示例#3
0
 public void Fetch(string commitish)
 {
     GitProcess.Invoke(this.RootPath, "fetch origin " + commitish);
 }