using System; using System.Collections.Generic; 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); /// /// 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); /// /// 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); /// /// 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); /// /// 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); /// /// 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, string logMessage); /// /// 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. /// [Obsolete("This method will be removed in the next release. Please use Index.Replace() instead.")] void Reset(Commit commit, IEnumerable paths, ExplicitPathsOptions explicitPathsOptions); /// /// 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); /// /// 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); /// /// 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); /// /// 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); /// /// Merge the reference that was recently fetched. This will merge /// the branch on the fetched remote that corresponded to the /// current local branch when we did the fetch. This is the /// second step in performing a pull operation (after having /// performed said fetch). /// /// The of who is performing the merge. /// Specifies optional parameters controlling merge behavior; if null, the defaults are used. /// The of the merge. MergeResult MergeFetchedRefs(Signature merger, MergeOptions options); /// /// 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); /// /// 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); /// /// Promotes to the staging area the latest modifications of a file in the working directory (addition, updation or removal). /// /// If this path is ignored by configuration then it will not be staged unless is unset. /// /// The path of the file within the working directory. /// Determines how paths will be staged. void Stage(string path, StageOptions stageOptions); /// /// Promotes to the staging area the latest modifications of a collection of files in the working directory (addition, updation or removal). /// /// Any paths (even those listed explicitly) that are ignored by configuration will not be staged unless is unset. /// /// The collection of paths of the files within the working directory. /// Determines how paths will be staged. void Stage(IEnumerable paths, StageOptions stageOptions); /// /// Removes from the staging area all the modifications of a file since the latest commit (addition, updation or removal). /// /// The path of the file within the working directory. /// /// The passed will be treated as explicit paths. /// Use these options to determine how unmatched explicit paths should be handled. /// void Unstage(string path, ExplicitPathsOptions explicitPathsOptions); /// /// Removes from the staging area all the modifications of a collection of file since the latest commit (addition, updation or removal). /// /// The collection of paths of the files within the working directory. /// /// The passed will be treated as explicit paths. /// Use these options to determine how unmatched explicit paths should be handled. /// void Unstage(IEnumerable paths, ExplicitPathsOptions explicitPathsOptions); /// /// Moves and/or renames a file in the working directory and promotes the change to the staging area. /// /// The path of the file within the working directory which has to be moved/renamed. /// The target path of the file within the working directory. void Move(string sourcePath, string destinationPath); /// /// Moves and/or renames a collection of files in the working directory and promotes the changes to the staging area. /// /// The paths of the files within the working directory which have to be moved/renamed. /// The target paths of the files within the working directory. void Move(IEnumerable sourcePaths, IEnumerable destinationPaths); /// /// Removes a file from the staging area, and optionally removes it from the working directory as well. /// /// If the file has already been deleted from the working directory, this method will only deal /// with promoting the removal to the staging area. /// /// /// The default behavior is to remove the file from the working directory as well. /// /// /// When not passing a , the passed path will be treated as /// a pathspec. You can for example use it to pass the relative path to a folder inside the working directory, /// so that all files beneath this folders, and the folder itself, will be removed. /// /// /// The path of the file within the working directory. /// True to remove the file from the working directory, False otherwise. /// /// The passed will be treated as an explicit path. /// Use these options to determine how unmatched explicit paths should be handled. /// void Remove(string path, bool removeFromWorkingDirectory, ExplicitPathsOptions explicitPathsOptions); /// /// Removes a collection of fileS from the staging, and optionally removes them from the working directory as well. /// /// If a file has already been deleted from the working directory, this method will only deal /// with promoting the removal to the staging area. /// /// /// The default behavior is to remove the files from the working directory as well. /// /// /// When not passing a , the passed paths will be treated as /// a pathspec. You can for example use it to pass the relative paths to folders inside the working directory, /// so that all files beneath these folders, and the folders themselves, will be removed. /// /// /// The collection of paths of the files within the working directory. /// True to remove the files from the working directory, False otherwise. /// /// The passed will be treated as explicit paths. /// Use these options to determine how unmatched explicit paths should be handled. /// void Remove(IEnumerable paths, bool removeFromWorkingDirectory, ExplicitPathsOptions explicitPathsOptions); /// /// Retrieves the state of a file in the working directory, comparing it against the staging area and the latest commmit. /// /// The relative path within the working directory to the file. /// A representing the state of the parameter. FileStatus RetrieveStatus(string filePath); /// /// Retrieves the state of all files in the working directory, comparing them against the staging area and the latest commmit. /// /// If set, the options that control the status investigation. /// A holding the state of all the files. RepositoryStatus RetrieveStatus(StatusOptions options); /// /// Finds the most recent annotated tag that is reachable from a commit. /// /// If the tag points to the commit, then only the tag is shown. Otherwise, /// it suffixes the tag name with the number of additional commits on top /// of the tagged object and the abbreviated object name of the most recent commit. /// /// /// Optionally, the parameter allow to tweak the /// search strategy (considering lightweith tags, or even branches as reference points) /// and the formatting of the returned identifier. /// /// /// The commit to be described. /// Determines how the commit will be described. /// A descriptive identifier for the commit based on the nearest annotated tag. string Describe(Commit commit, DescribeOptions options); } }