using System; using System.Collections.Generic; using LibGit2Sharp; using Branch = LibGit2Sharp.Branch; namespace Sep.Git.Tfs.Core { public interface IGitRepository : IGitHelpers { string GitDir { get; set; } string GetConfig(string key); T GetConfig(string key); T GetConfig(string key, T defaultValue); void SetConfig(string key, string value); IEnumerable ReadAllTfsRemotes(); IGitTfsRemote ReadTfsRemote(string remoteId); IGitTfsRemote CreateTfsRemote(RemoteInfo remoteInfo, string autocrlf = null, string ignorecase = null); void DeleteTfsRemote(IGitTfsRemote remoteId); IEnumerable GetGitRemoteBranches(string gitRemote); bool HasRemote(string remoteId); bool HasRef(string gitRef); GitCommit Commit(LogEntry logEntry); void UpdateRef(string gitRefName, string commitSha, string message = null); void MoveTfsRefForwardIfNeeded(IGitTfsRemote remote); IEnumerable GetLastParentTfsCommits(string head); TfsChangesetInfo GetTfsChangesetById(string remoteRef, long changesetId); TfsChangesetInfo GetTfsCommit(string sha); TfsChangesetInfo GetCurrentTfsCommit(); IDictionary CreateObjectsDictionary(); IDictionary GetObjects(string commit); IDictionary GetObjects(string commit, IDictionary initialTree); IGitTreeBuilder GetTreeBuilder(string commit); IEnumerable GetChangedFiles(string from, string to); bool WorkingCopyHasUnstagedOrUncommitedChanges { get; } void CopyBlob(string sha, string outputFile); GitCommit GetCommit(string commitish); MergeResult Merge(string commitish); string GetCurrentCommit(); string GetCommitMessage(string head, string parentCommitish); string AssertValidBranchName(string gitBranchName); bool CreateBranch(string gitBranchName, string target); Branch RenameBranch(string oldName, string newName); string FindCommitHashByChangesetId(long changesetId); void CreateTag(string name, string sha, string comment, string Owner, string emailOwner, System.DateTime creationDate); void CreateNote(string sha, string content, string owner, string emailOwner, DateTime creationDate); void MoveRemote(string oldRemoteName, string newRemoteName); void ResetHard(string sha); bool IsBare { get; } /// Gets all configured "subtree" remotes which point to the same Tfs URL as the given remote. /// If the given remote is itself a subtree, an empty enumerable is returned. /// IEnumerable GetSubtrees(IGitTfsRemote owner); void ResetRemote(IGitTfsRemote remoteToReset, string target); string GetCurrentBranch(); void GarbageCollect(bool auto = false, string additionalMessage = null); bool Checkout(string commitish); } }