Esempio n. 1
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposedValue)
     {
         LibGit2Helpers.Repo.Free(this.repoHandle);
         LibGit2Helpers.Shutdown();
         this.disposedValue = true;
     }
 }
Esempio n. 2
0
        public LibGit2Repo(ITracer tracer, string repoPath)
        {
            this.tracer = tracer;
            LibGit2Helpers.Init();

            if (LibGit2Helpers.Repo.Open(out this.repoHandle, repoPath) != LibGit2Helpers.SuccessCode)
            {
                string reason  = LibGit2Helpers.GetLastError();
                string message = "Couldn't open repo at " + repoPath + ": " + reason;
                tracer.RelatedError(message);

                LibGit2Helpers.Shutdown();
                throw new InvalidDataException(message);
            }
        }