# README
Git Module
This module is merged from https://github.com/go-gitea/git which is a Go module to access Git through shell commands. Now it's a part of gitea's main repository for easier pull request.
# Packages
No description provided by the author
# Functions
AddChanges marks local changes to be ready for commit.
AddChangesWithArgs marks local changes to be ready for commit.
AllCommitsCount returns count of all commits in repository.
BinVersion returns current Git version from shell.
Checkout checkouts a branch.
Clone clones original repository to target path.
CloneWithArgs original repository to target path.
CommitChanges commits local changes with given committer, author and message.
CommitChangesWithArgs commits local changes with given committer, author and message.
CommitFromReader will generate a Commit from a provided reader We will need this to interpret commits from cat-file.
CommitsCount returns number of total commits of until given revision.
CountObjects returns the results of git count-objects on the repoPath.
CreateBlameReader creates reader for given repository, commit and file.
CutDiffAroundLine cuts a diff of a file in way that only the given line + numberOfLine above it will be shown it also recalculates hunks and adds the appropriate headers to the new diff.
Fsck verifies the connectivity and validity of the objects in the database.
GetBranchesByPath returns a branch by it's path.
GetCommitFileStatus returns file status of commit in given repository.
GetDivergingCommits returns the number of commits a targetBranch is ahead or behind a baseBranch.
GetFullCommitID returns full length (40) of commit ID by given short SHA in a repository.
GetHook returns a Git hook by given name and repository.
GetLatestCommitTime returns time for latest commit in repository (across all branches).
GetNote retrieves the git-notes data for a given commit.
GetRawDiff dumps diff results of repository in given commit ID to io.Writer.
GetRawDiffForFile dumps diff results of file in given commit ID to io.Writer.
GetRepoRawDiffForFile dumps diff results of file in given commit ID to io.Writer according given repository.
Init initializes git module.
InitRepository initializes a new Git repository.
IsBranchExist returns true if given branch exists in the repository.
IsErrBranchNotExist checks if an error is a ErrBranchNotExist.
IsErrExecTimeout if some error is ErrExecTimeout.
IsErrNotExist if some error is ErrNotExist.
IsErrUnsupportedVersion if some error is ErrUnsupportedVersion.
IsReferenceExist returns true if given reference exists in the repository.
IsRepoURLAccessible checks if given repository URL is accessible.
IsTagExist returns true if given tag exists in the repository.
IsValidHookName returns true if given name is a valid Git hook.
ListHooks returns a list of Git hooks of given repository.
MoveFile moves a file to another file or directory.
MustID always creates a new SHA1 from a [20]byte array with no validation of input.
MustIDFromString always creates a new sha from a ID with no validation of input.
NewCommand creates and returns a new Git Command based on given command and arguments.
NewCommandNoGlobals creates and returns a new Git Command based on given command and arguments only with the specify args and don't care global command args.
NewCommitFileStatus creates a CommitFileStatus.
NewID creates a new SHA1 from a [20]byte array.
NewIDFromString creates a new SHA1 from a ID string of length 40.
NewSearchCommitsOptions construct a SearchCommitsOption from a space-delimited search string.
NewSubModuleFile create a new submodule file.
NewTree create a new tree according the repository and tree id.
OpenRepository opens the repository at the given path.
ParseBool returns the boolean value represented by the string as per git's git_config_bool true will be returned for the result if the string is empty, but valid will be false.
ParseDiffHunkString parse the diffhunk content and return.
ParseTreeEntries parses the output of a `git ls-tree` command.
Pull pulls changes from remotes.
Push pushs local commits to given remote branch.
RefEndName return the end name of a ref name.
ResetHEAD resets HEAD to given revision or head of branch.
SetExecutablePath changes the path of git executable and checks the file permission and version.
SetUpdateHook writes given content to update hook of the reposiotry.
SplitRefName splits a full refname to reftype and simple refname.
Version return this package's current version.
# Constants
BranchPrefix base dir of the branch information file store on git.
DefaultLocale is the default LC_ALL to run git commands in.
EmptySHA defines empty git SHA.
EntryModeBlob.
EntryModeCommit.
EntryModeExec.
EntryModeSymlink.
EntryModeTree.
GitTimeLayout is the (default) time layout used by git.
HookPathUpdate hook update path.
NotesRef is the git ref where Gitea will look for git-notes data.
ObjectBlob blob object type.
ObjectBranch branch object type.
ObjectCommit commit object type.
ObjectTag tag object type.
ObjectTree tree object type.
RawDiffType possible values.
RawDiffType possible values.
TagPrefix tags prefix path on the repository.
TARGZ tar gz archive type.
ZIP zip archive type.
# Variables
CommitsRangeSize the default commits range size.
Debug enables verbose logging on everything.
DefaultCommandExecutionTimeout default command execution timeout duration.
DefaultContext is the default context to run git commands in.
ErrNotValidHook error when a git hook is not valid.
GitExecutable is the command name of git Could be updated to an absolute path while initialization.
GitVersionRequired is the minimum Git version required.
GlobalCommandArgs global command args for external package setting.
Prefix the log prefix.
# Structs
BlamePart represents block of blame - continuous lines with one sha.
BlameReader returns part of file blame one by one.
Blob represents a Git object.
Branch represents a Git branch.
CheckAttributeOpts represents the possible options to CheckAttribute.
CheckoutOptions options when heck out some branch.
CloneRepoOptions options when clone a repository.
CodeActivityAuthor represents git statistics data for commit authors.
CodeActivityStats represents git statistics data.
Command represents a command with its subcommands or arguments.
Commit represents a git commit.
CommitChangesOptions the options when a commit created.
CommitFileStatus represents status of files in a commit.
CommitGPGSignature represents a git commit signature part.
CommitTreeOpts represents the possible options to CommitTree.
CompareInfo represents needed information for comparing references.
CountObject represents repository count objects report.
CreateArchiveOpts represents options for creating an archive.
DeleteBranchOptions Option(s) for delete branch.
DivergeObject represents commit count diverging commits.
ErrBadLink entry.FollowLink error.
ErrBranchNotExist represents a "BranchNotExist" kind of error.
ErrExecTimeout error when exec timed out.
ErrNotExist commit not exist error.
ErrUnsupportedVersion error when required git version not matched.
GPGSettings represents the default GPG settings for this repository.
Hook represents a Git hook.
ImageMetaData represents metadata of an image file.
Note stores information about a note created using git-notes.
ObjectCache provides thread-safe cache opeations.
PullRemoteOptions options when pull from remote.
PushOptions options when push to remote.
Reference represents a Git ref.
Repository represents a Git repository.
SearchCommitsOptions specify the parameters for SearchCommits.
SubModule submodule is a reference on git repository.
SubModuleFile represents a file with submodule type.
Tag represents a Git tag.
Tree represents a flat directory listing.
TreeEntry the leaf in the git tree.
# Interfaces
LastCommitCache cache.
# Type aliases
ArchiveType archive types.
Entries a list of entry.
EntryMode the type of the object in the git tree.
ObjectType git object type.
RawDiffType type of a raw diff.
SHA1 a git commit name.
Signature represents the Author or Committer information.