using System;
using System.Collections.Generic;
using LibGit2Sharp.Handlers;
namespace LibGit2Sharp
{
///
/// A Repository is the primary interface into a git repository
///
public interface IRepository : IDisposable
{
///
/// Shortcut to return the branch pointed to by HEAD
///
Branch Head { get; }
///
/// Provides access to the configuration settings for this repository.
///
Configuration Config { get; }
///
/// Gets the index.
///
Index Index { get; }
///
/// Lookup and enumerate references in the repository.
///
ReferenceCollection Refs { get; }
///
/// Lookup and enumerate commits in the repository.
/// Iterating this collection directly starts walking from the HEAD.
///
IQueryableCommitLog Commits { get; }
///
/// Lookup and enumerate branches in the repository.
///
BranchCollection Branches { get; }
///
/// Lookup and enumerate tags in the repository.
///
TagCollection Tags { get; }
///
/// Provides high level information about this repository.
///
RepositoryInformation Info { get; }
///
/// Provides access to diffing functionalities to show changes between the working tree and the index or a tree, changes between the index and a tree, changes between two trees, or changes between two files on disk.
///
Diff Diff {get;}
///
/// Gets the database.
///
ObjectDatabase ObjectDatabase { get; }
///
/// Lookup notes in the repository.
///
NoteCollection Notes { get; }
///
/// Submodules in the repository.
///
SubmoduleCollection Submodules { get; }
///
/// Checkout the commit pointed at by the tip of the specified .
///
/// If this commit is the current tip of the branch as it exists in the repository, the HEAD
/// will point to this branch. Otherwise, the HEAD will be detached, pointing at the commit sha.
///
///
/// The to check out.
/// controlling checkout behavior.
/// Identity for use when updating the reflog.
/// The that was checked out.
Branch Checkout(Branch branch, CheckoutOptions options, Signature signature = null);
///
/// Checkout the specified branch, reference or SHA.
///
/// If the committishOrBranchSpec parameter resolves to a branch name, then the checked out HEAD will
/// will point to the branch. Otherwise, the HEAD will be detached, pointing at the commit sha.
///
///
/// A revparse spec for the commit or branch to checkout.
/// controlling checkout behavior.
/// Identity for use when updating the reflog.
/// The that was checked out.
Branch Checkout(string committishOrBranchSpec, CheckoutOptions options, Signature signature = null);
///
/// Checkout the specified .
///
/// Will detach the HEAD and make it point to this commit sha.
///
///
/// The to check out.
/// controlling checkout behavior.
/// Identity for use when updating the reflog.
/// The that was checked out.
Branch Checkout(Commit commit, CheckoutOptions options, Signature signature = null);
///
/// Updates specifed paths in the index and working directory with the versions from the specified branch, reference, or SHA.
///
/// This method does not switch branches or update the current repository HEAD.
///
///
/// A revparse spec for the commit or branch to checkout paths from.
/// The paths to checkout.
/// Collection of parameters controlling checkout behavior.
void CheckoutPaths(string committishOrBranchSpec, IEnumerable paths, CheckoutOptions checkoutOptions = null);
///
/// Try to lookup an object by its . If no matching object is found, null will be returned.
///
/// The id to lookup.
/// The or null if it was not found.
GitObject Lookup(ObjectId id);
///
/// Try to lookup an object by its sha or a reference canonical name. If no matching object is found, null will be returned.
///
/// A revparse spec for the object to lookup.
/// The or null if it was not found.
GitObject Lookup(string objectish);
///
/// Try to lookup an object by its and . If no matching object is found, null will be returned.
///
/// The id to lookup.
/// The kind of GitObject being looked up
/// The or null if it was not found.
GitObject Lookup(ObjectId id, ObjectType type);
///
/// Try to lookup an object by its sha or a reference canonical name and . If no matching object is found, null will be returned.
///
/// A revparse spec for the object to lookup.
/// The kind of being looked up
/// The or null if it was not found.
GitObject Lookup(string objectish, ObjectType type);
///
/// Stores the content of the as a new into the repository.
/// The tip of the will be used as the parent of this new Commit.
/// Once the commit is created, the will move forward to point at it.
///
/// The description of why a change was made to the repository.
/// The of who made the change.
/// The of who added the change to the repository.
/// The that specify the commit behavior.
/// The generated .
Commit Commit(string message, Signature author, Signature committer, CommitOptions options = null);
///
/// Sets the current to the specified commit and optionally resets the and
/// the content of the working tree to match.
///
/// Flavor of reset operation to perform.
/// The target commit object.
/// Identity for use when updating the reflog.
/// Message to use when updating the reflog.
void Reset(ResetMode resetMode, Commit commit, Signature signature = null, string logMessage = null);
///
/// Replaces entries in the with entries from the specified commit.
///
/// The target commit object.
/// The list of paths (either files or directories) that should be considered.
///
/// If set, the passed will be treated as explicit paths.
/// Use these options to determine how unmatched explicit paths should be handled.
///
void Reset(Commit commit, IEnumerable paths = null, ExplicitPathsOptions explicitPathsOptions = null);
///
/// Clean the working tree by removing files that are not under version control.
///
void RemoveUntrackedFiles();
///
/// Revert the specified commit.
///
/// The to revert.
/// The of who is performing the reverte.
/// controlling revert behavior.
/// The result of the revert.
RevertResult Revert(Commit commit, Signature reverter, RevertOptions options = null);
///
/// Merge changes from commit into the branch pointed at by HEAD..
///
/// The commit to merge into the branch pointed at by HEAD.
/// The of who is performing the merge.
/// Specifies optional parameters controlling merge behavior; if null, the defaults are used.
/// The of the merge.
MergeResult Merge(Commit commit, Signature merger, MergeOptions options = null);
///
/// Merges changes from branch into the branch pointed at by HEAD..
///
/// The branch to merge into the branch pointed at by HEAD.
/// The of who is performing the merge.
/// Specifies optional parameters controlling merge behavior; if null, the defaults are used.
/// The of the merge.
MergeResult Merge(Branch branch, Signature merger, MergeOptions options = null);
///
/// Merges changes from the commit into the branch pointed at by HEAD.
///
/// The commit to merge into branch pointed at by HEAD.
/// The of who is performing the merge.
/// Specifies optional parameters controlling merge behavior; if null, the defaults are used.
/// The of the merge.
MergeResult Merge(string committish, Signature merger, MergeOptions options = null);
///
/// Cherry picks changes from the commit into the branch pointed at by HEAD.
///
/// The commit to cherry pick into branch pointed at by HEAD.
/// The of who is performing the cherry pick.
/// Specifies optional parameters controlling cherry pick behavior; if null, the defaults are used.
/// The of the merge.
CherryPickResult CherryPick(Commit commit, Signature committer, CherryPickOptions options = null);
///
/// Manipulate the currently ignored files.
///
Ignore Ignore { get; }
///
/// Provides access to network functionality for a repository.
///
Network Network { get; }
///
/// Lookup and enumerate stashes in the repository.
///
StashCollection Stashes { get; }
///
/// Find where each line of a file originated.
///
/// Path of the file to blame.
/// Specifies optional parameters; if null, the defaults are used.
/// The blame for the file.
BlameHunkCollection Blame(string path, BlameOptions options = null);
}
}