Documentation ¶
Index ¶
- Constants
- Variables
- func CallbackGitTreeWalk(_root unsafe.Pointer, _entry unsafe.Pointer, ptr unsafe.Pointer) C.int
- func ConfigFindGlobal() (string, error)
- func ConfigFindSystem() (string, error)
- func ConfigFindXDG() (string, error)
- func Discover(start string, across_fs bool, ceiling_dirs []string) (string, error)
- func IsErrorClass(err error, c ErrorClass) bool
- func IsErrorCode(err error, c ErrorCode) bool
- func MakeGitError(errorCode C.int) error
- func MakeGitError2(err int) error
- func MwindowMappedLimit() (int, error)
- func MwindowSize() (int, error)
- func RemoteIsValidName(name string) bool
- func SearchPath(level ConfigLevel) (string, error)
- func SetMwindowMappedLimit(size int) error
- func SetMwindowSize(size int) error
- func SetSearchPath(level ConfigLevel, path string) error
- func ShortenOids(ids []*Oid, minlen int) (int, error)
- func SubmoduleStatusIsUnmodified(status int) bool
- func SubmoduleVisitor(csub unsafe.Pointer, name *C.char, cfct unsafe.Pointer) C.int
- type AnnotatedCommit
- type Blame
- type BlameHunk
- type BlameOptions
- type BlameOptionsFlag
- type Blob
- type BlobCallbackData
- type BlobChunkCallback
- type Branch
- func (b *Branch) Delete() error
- func (b *Branch) IsHead() (bool, error)
- func (b *Branch) Move(newBranchName string, force bool, signature *Signature, msg string) (*Branch, error)
- func (b *Branch) Name() (string, error)
- func (b *Branch) SetUpstream(upstreamName string) error
- func (b *Branch) Upstream() (*Reference, error)
- type BranchIterator
- type BranchIteratorFunc
- type BranchType
- type Certificate
- type CertificateCheckCallback
- type CertificateKind
- type CheckoutOpts
- type CheckoutStrategy
- type CherrypickOptions
- type CloneOptions
- type Commit
- func (c *Commit) Amend(refname string, author, committer *Signature, message string, tree *Tree) (*Oid, error)
- func (c Commit) Author() *Signature
- func (c Commit) Committer() *Signature
- func (o *Commit) Free()
- func (o Commit) Id() *Oid
- func (c Commit) Message() string
- func (o Commit) Owner() *Repository
- func (c *Commit) Parent(n uint) *Commit
- func (c *Commit) ParentCount() uint
- func (c *Commit) ParentId(n uint) *Oid
- func (c Commit) Summary() string
- func (c Commit) Tree() (*Tree, error)
- func (c Commit) TreeId() *Oid
- func (o Commit) Type() ObjectType
- type CompletionCallback
- type Config
- func (c *Config) AddFile(path string, level ConfigLevel, force bool) error
- func (c *Config) Delete(name string) error
- func (c *Config) Free()
- func (c *Config) LookupBool(name string) (bool, error)
- func (c *Config) LookupInt32(name string) (int32, error)
- func (c *Config) LookupInt64(name string) (int64, error)
- func (c *Config) LookupString(name string) (string, error)
- func (c *Config) NewIterator() (*ConfigIterator, error)
- func (c *Config) NewIteratorGlob(regexp string) (*ConfigIterator, error)
- func (c *Config) NewMultivarIterator(name, regexp string) (*ConfigIterator, error)
- func (c *Config) OpenLevel(parent *Config, level ConfigLevel) (*Config, error)
- func (c *Config) SetBool(name string, value bool) (err error)
- func (c *Config) SetInt32(name string, value int32) (err error)
- func (c *Config) SetInt64(name string, value int64) (err error)
- func (c *Config) SetMultivar(name, regexp, value string) (err error)
- func (c *Config) SetString(name, value string) (err error)
- type ConfigEntry
- type ConfigIterator
- type ConfigLevel
- type ConnectDirection
- type Cred
- type CredType
- type CredentialsCallback
- type Delta
- type Diff
- func (diff *Diff) FindSimilar(opts *DiffFindOptions) error
- func (diff *Diff) ForEach(cbFile DiffForEachFileCallback, detail DiffDetail) error
- func (diff *Diff) Free() error
- func (diff *Diff) GetDelta(index int) (DiffDelta, error)
- func (diff *Diff) NumDeltas() (int, error)
- func (diff *Diff) Patch(deltaIndex int) (*Patch, error)
- func (diff *Diff) Stats() (*DiffStats, error)
- type DiffDelta
- type DiffDetail
- type DiffFile
- type DiffFindOptions
- type DiffFindOptionsFlag
- type DiffFlag
- type DiffForEachFileCallback
- type DiffForEachHunkCallback
- type DiffForEachLineCallback
- type DiffHunk
- type DiffLine
- type DiffLineType
- type DiffNotifyCallback
- type DiffOptions
- type DiffOptionsFlag
- type DiffStats
- type ErrorClass
- type ErrorCode
- type Filemode
- type GitError
- type HostkeyCertificate
- type HostkeyKind
- type Index
- func (v *Index) Add(entry *IndexEntry) error
- func (v *Index) AddAll(pathspecs []string, flags IndexAddOpts, callback IndexMatchedPathCallback) error
- func (v *Index) AddByPath(path string) error
- func (v *Index) AddConflict(ancestor *IndexEntry, our *IndexEntry, their *IndexEntry) error
- func (v *Index) CleanupConflicts()
- func (v *Index) ConflictIterator() (*IndexConflictIterator, error)
- func (v *Index) EntryByIndex(index uint) (*IndexEntry, error)
- func (v *Index) EntryCount() uint
- func (v *Index) Free()
- func (v *Index) GetConflict(path string) (IndexConflict, error)
- func (v *Index) HasConflicts() bool
- func (v *Index) RemoveAll(pathspecs []string, callback IndexMatchedPathCallback) error
- func (v *Index) RemoveByPath(path string) error
- func (v *Index) RemoveConflict(path string) error
- func (v *Index) UpdateAll(pathspecs []string, callback IndexMatchedPathCallback) error
- func (v *Index) Write() error
- func (v *Index) WriteTree() (*Oid, error)
- func (v *Index) WriteTreeTo(repo *Repository) (*Oid, error)
- type IndexAddOpts
- type IndexConflict
- type IndexConflictIterator
- type IndexEntry
- type IndexMatchedPathCallback
- type MergeAnalysis
- type MergeFileFavor
- type MergeFileFlags
- type MergeFileInput
- type MergeFileOptions
- type MergeFileResult
- type MergeOptions
- type MergePreference
- type MergeTreeFlag
- type Note
- type NoteIterator
- type Object
- type ObjectType
- type Odb
- func (v *Odb) AddBackend(backend *OdbBackend, priority int) (err error)
- func (v *Odb) Exists(oid *Oid) bool
- func (v *Odb) ForEach(callback OdbForEachCallback) error
- func (v *Odb) Free()
- func (v *Odb) Hash(data []byte, otype ObjectType) (oid *Oid, err error)
- func (v *Odb) NewReadStream(id *Oid) (*OdbReadStream, error)
- func (v *Odb) NewWriteStream(size int, otype ObjectType) (*OdbWriteStream, error)
- func (v *Odb) Read(oid *Oid) (obj *OdbObject, err error)
- func (v *Odb) Write(data []byte, otype ObjectType) (oid *Oid, err error)
- type OdbBackend
- type OdbForEachCallback
- type OdbObject
- type OdbReadStream
- type OdbWriteStream
- type Oid
- type Packbuilder
- func (pb *Packbuilder) ForEach(callback PackbuilderForeachCallback) error
- func (pb *Packbuilder) Free()
- func (pb *Packbuilder) Insert(id *Oid, name string) error
- func (pb *Packbuilder) InsertCommit(id *Oid) error
- func (pb *Packbuilder) InsertTree(id *Oid) error
- func (pb *Packbuilder) ObjectCount() uint32
- func (pb *Packbuilder) Write(w io.Writer) error
- func (pb *Packbuilder) WriteToFile(name string, mode os.FileMode) error
- func (pb *Packbuilder) Written() uint32
- type PackbuilderForeachCallback
- type PackbuilderProgressCallback
- type Patch
- type PushOptions
- type PushTransferProgressCallback
- type PushUpdateReferenceCallback
- type Refdb
- type RefdbBackend
- type Reference
- func (r *Reference) Branch() *Branch
- func (v *Reference) Cmp(ref2 *Reference) int
- func (v *Reference) Delete() error
- func (v *Reference) Free()
- func (v *Reference) IsBranch() bool
- func (v *Reference) IsRemote() bool
- func (v *Reference) IsTag() bool
- func (v *Reference) Name() string
- func (v *Reference) Owner() *Repository
- func (v *Reference) Peel(t ObjectType) (Object, error)
- func (v *Reference) Rename(name string, force bool, sig *Signature, msg string) (*Reference, error)
- func (v *Reference) Resolve() (*Reference, error)
- func (v *Reference) SetSymbolicTarget(target string, sig *Signature, msg string) (*Reference, error)
- func (v *Reference) SetTarget(target *Oid, sig *Signature, msg string) (*Reference, error)
- func (v *Reference) Shorthand() string
- func (v *Reference) SymbolicTarget() string
- func (v *Reference) Target() *Oid
- func (v *Reference) Type() ReferenceType
- type ReferenceIterator
- type ReferenceNameIterator
- type ReferenceType
- type Remote
- func (o *Remote) AddFetch(refspec string) error
- func (o *Remote) AddPush(refspec string) error
- func (o *Remote) ClearRefspecs()
- func (o *Remote) Connect(direction ConnectDirection) error
- func (o *Remote) ConnectFetch() error
- func (o *Remote) ConnectPush() error
- func (o *Remote) Fetch(refspecs []string, sig *Signature, msg string) error
- func (o *Remote) FetchRefspecs() ([]string, error)
- func (r *Remote) Free()
- func (o *Remote) Ls(filterRefs ...string) ([]RemoteHead, error)
- func (o *Remote) Name() string
- func (o *Remote) Owner() Repository
- func (o *Remote) Prune() error
- func (o *Remote) PruneRefs() bool
- func (o *Remote) Push(refspecs []string, opts *PushOptions, sig *Signature, msg string) error
- func (o *Remote) PushRefspecs() ([]string, error)
- func (o *Remote) PushUrl() string
- func (o *Remote) RefspecCount() uint
- func (o *Remote) Save() error
- func (r *Remote) SetCallbacks(callbacks *RemoteCallbacks) error
- func (o *Remote) SetFetchRefspecs(refspecs []string) error
- func (o *Remote) SetPushRefspecs(refspecs []string) error
- func (o *Remote) SetPushUrl(url string) error
- func (o *Remote) SetUpdateFetchHead(val bool)
- func (o *Remote) SetUrl(url string) error
- func (o *Remote) UpdateFetchHead() bool
- func (o *Remote) Url() string
- type RemoteCallbacks
- type RemoteCompletion
- type RemoteHead
- type Repository
- func Clone(url string, path string, options *CloneOptions) (*Repository, error)
- func InitRepository(path string, isbare bool) (*Repository, error)
- func NewRepositoryWrapOdb(odb *Odb) (repo *Repository, err error)
- func OpenRepository(path string) (*Repository, error)
- func OpenRepositoryExtended(path string) (*Repository, error)
- func (repo *Repository) AddSubmodule(url, path string, use_git_link bool) (*Submodule, error)
- func (repo *Repository) AheadBehind(local, upstream *Oid) (ahead, behind int, err error)
- func (r *Repository) AnnotatedCommitFromFetchHead(branchName string, remoteURL string, oid *Oid) (*AnnotatedCommit, error)
- func (r *Repository) AnnotatedCommitFromRef(ref *Reference) (*AnnotatedCommit, error)
- func (v *Repository) BlameFile(path string, opts *BlameOptions) (*Blame, error)
- func (v *Repository) CheckoutHead(opts *CheckoutOpts) error
- func (v *Repository) CheckoutIndex(index *Index, opts *CheckoutOpts) error
- func (v *Repository) CheckoutTree(tree *Tree, opts *CheckoutOpts) error
- func (v *Repository) Cherrypick(commit *Commit, opts CherrypickOptions) error
- func (v *Repository) Config() (*Config, error)
- func (repo *Repository) CreateAnonymousRemote(url, fetch string) (*Remote, error)
- func (repo *Repository) CreateBlobFromBuffer(data []byte) (*Oid, error)
- func (repo *Repository) CreateBlobFromChunks(hintPath string, callback BlobChunkCallback) (*Oid, error)
- func (repo *Repository) CreateBranch(branchName string, target *Commit, force bool, signature *Signature, ...) (*Branch, error)
- func (v *Repository) CreateCommit(refname string, author, committer *Signature, message string, tree *Tree, ...) (*Oid, error)
- func (v *Repository) CreateNote(ref string, author, committer *Signature, id *Oid, note string, force bool) (*Oid, error)
- func (v *Repository) CreateReference(name string, id *Oid, force bool, sig *Signature, msg string) (*Reference, error)
- func (repo *Repository) CreateRemote(name string, url string) (*Remote, error)
- func (repo *Repository) CreateRemoteWithFetchspec(name string, url string, fetch string) (*Remote, error)
- func (v *Repository) CreateSymbolicReference(name, target string, force bool, sig *Signature, msg string) (*Reference, error)
- func (v *Repository) CreateTag(name string, commit *Commit, tagger *Signature, message string) (*Oid, error)
- func (v *Repository) DefaultNoteRef() (string, error)
- func (repo *Repository) DefaultSignature() (*Signature, error)
- func (repo *Repository) DeleteRemote(name string) error
- func (repo *Repository) DescendantOf(commit, ancestor *Oid) (bool, error)
- func (v *Repository) DiffIndexToWorkdir(index *Index, opts *DiffOptions) (*Diff, error)
- func (v *Repository) DiffTreeToTree(oldTree, newTree *Tree, opts *DiffOptions) (*Diff, error)
- func (v *Repository) DiffTreeToWorkdir(oldTree *Tree, opts *DiffOptions) (*Diff, error)
- func (v *Repository) DiffTreeToWorkdirWithIndex(oldTree *Tree, opts *DiffOptions) (*Diff, error)
- func (v *Repository) DwimReference(name string) (*Reference, error)
- func (v *Repository) EnsureLog(name string) error
- func (repo *Repository) ForeachSubmodule(cbk SubmoduleCbk) error
- func (v *Repository) Free()
- func (v *Repository) HasLog(name string) (bool, error)
- func (v *Repository) Head() (*Reference, error)
- func (v *Repository) Index() (*Index, error)
- func (repo *Repository) IsBare() bool
- func (repo *Repository) ListRemotes() ([]string, error)
- func (v *Repository) Lookup(id *Oid) (Object, error)
- func (r *Repository) LookupAnnotatedCommit(oid *Oid) (*AnnotatedCommit, error)
- func (v *Repository) LookupBlob(id *Oid) (*Blob, error)
- func (repo *Repository) LookupBranch(branchName string, bt BranchType) (*Branch, error)
- func (v *Repository) LookupCommit(id *Oid) (*Commit, error)
- func (v *Repository) LookupReference(name string) (*Reference, error)
- func (repo *Repository) LookupRemote(name string) (*Remote, error)
- func (repo *Repository) LookupSubmodule(name string) (*Submodule, error)
- func (v *Repository) LookupTag(id *Oid) (*Tag, error)
- func (v *Repository) LookupTree(id *Oid) (*Tree, error)
- func (r *Repository) Merge(theirHeads []*AnnotatedCommit, mergeOptions *MergeOptions, ...) error
- func (r *Repository) MergeAnalysis(theirHeads []*AnnotatedCommit) (MergeAnalysis, MergePreference, error)
- func (r *Repository) MergeBase(one *Oid, two *Oid) (*Oid, error)
- func (r *Repository) MergeCommits(ours *Commit, theirs *Commit, options *MergeOptions) (*Index, error)
- func (r *Repository) MergeTrees(ancestor *Tree, ours *Tree, theirs *Tree, options *MergeOptions) (*Index, error)
- func (repo *Repository) NewBranchIterator(flags BranchType) (*BranchIterator, error)
- func (repo *Repository) NewNoteIterator(ref string) (*NoteIterator, error)
- func (repo *Repository) NewPackbuilder() (*Packbuilder, error)
- func (v *Repository) NewRefdb() (refdb *Refdb, err error)
- func (repo *Repository) NewReferenceIterator() (*ReferenceIterator, error)
- func (repo *Repository) NewReferenceIteratorGlob(glob string) (*ReferenceIterator, error)
- func (repo *Repository) NewReferenceNameIterator() (*ReferenceNameIterator, error)
- func (v *Repository) Odb() (odb *Odb, err error)
- func (v *Repository) PatchFromBuffers(oldPath, newPath string, oldBuf, newBuf []byte, opts *DiffOptions) (*Patch, error)
- func (repo *Repository) Path() string
- func (v *Repository) ReadNote(ref string, id *Oid) (*Note, error)
- func (repo *Repository) ReloadAllSubmodules(force bool) error
- func (repo *Repository) RemoteName(canonicalBranchName string) (string, error)
- func (v *Repository) RemoveNote(ref string, author, committer *Signature, id *Oid) error
- func (r *Repository) Revparse(spec string) (*Revspec, error)
- func (r *Repository) RevparseExt(spec string) (Object, *Reference, error)
- func (v *Repository) RevparseSingle(spec string) (Object, error)
- func (v *Repository) SetHead(refname string, sig *Signature, msg string) error
- func (v *Repository) SetHeadDetached(id *Oid, sig *Signature, msg string) error
- func (v *Repository) SetRefdb(refdb *Refdb)
- func (repo *Repository) SetWorkdir(workdir string, updateGitlink bool) error
- func (r *Repository) State() RepositoryState
- func (r *Repository) StateCleanup() error
- func (v *Repository) StatusFile(path string) (Status, error)
- func (v *Repository) StatusList(opts *StatusOptions) (*StatusList, error)
- func (v *Repository) TreeBuilder() (*TreeBuilder, error)
- func (v *Repository) TreeBuilderFromTree(tree *Tree) (*TreeBuilder, error)
- func (repo *Repository) UpstreamName(canonicalBranchName string) (string, error)
- func (v *Repository) Walk() (*RevWalk, error)
- func (repo *Repository) Workdir() string
- type RepositoryState
- type RevWalk
- func (v *RevWalk) Free()
- func (v *RevWalk) Hide(id *Oid) error
- func (v *RevWalk) HideGlob(glob string) error
- func (v *RevWalk) HideHead() (err error)
- func (v *RevWalk) HideRef(r string) error
- func (v *RevWalk) Iterate(fun RevWalkIterator) (err error)
- func (v *RevWalk) Next(id *Oid) (err error)
- func (v *RevWalk) Push(id *Oid) error
- func (v *RevWalk) PushGlob(glob string) error
- func (v *RevWalk) PushHead() (err error)
- func (v *RevWalk) PushRange(r string) error
- func (v *RevWalk) PushRef(r string) error
- func (v *RevWalk) Reset()
- func (v *RevWalk) Sorting(sm SortType)
- type RevWalkIterator
- type RevparseFlag
- type Revspec
- type Signature
- type SortType
- type Status
- type StatusEntry
- type StatusList
- type StatusOpt
- type StatusOptions
- type StatusShow
- type Submodule
- func (sub *Submodule) AddToIndex(write_index bool) error
- func (sub *Submodule) FetchRecurseSubmodules() SubmoduleRecurse
- func (sub *Submodule) FinalizeAdd() error
- func (sub *Submodule) HeadId() *Oid
- func (sub *Submodule) Ignore() SubmoduleIgnore
- func (sub *Submodule) IndexId() *Oid
- func (sub *Submodule) Init(overwrite bool) error
- func (sub *Submodule) Name() string
- func (sub *Submodule) Open() (*Repository, error)
- func (sub *Submodule) Owner() *Repository
- func (sub *Submodule) Path() string
- func (sub *Submodule) Reload(force bool) error
- func (sub *Submodule) Save() error
- func (sub *Submodule) SetFetchRecurseSubmodules(recurse SubmoduleRecurse) error
- func (sub *Submodule) SetIgnore(ignore SubmoduleIgnore) SubmoduleIgnore
- func (sub *Submodule) SetUpdate(update SubmoduleUpdate) SubmoduleUpdate
- func (sub *Submodule) SetUrl(url string) error
- func (sub *Submodule) Sync() error
- func (sub *Submodule) Update(init bool, opts *SubmoduleUpdateOptions) error
- func (sub *Submodule) UpdateStrategy() SubmoduleUpdate
- func (sub *Submodule) Url() string
- func (sub *Submodule) WdId() *Oid
- type SubmoduleCbk
- type SubmoduleIgnore
- type SubmoduleRecurse
- type SubmoduleStatus
- type SubmoduleUpdate
- type SubmoduleUpdateOptions
- type Tag
- type TransferProgress
- type TransferProgressCallback
- type TransportMessageCallback
- type Tree
- func (t Tree) EntryByIndex(index uint64) *TreeEntry
- func (t Tree) EntryByName(filename string) *TreeEntry
- func (t Tree) EntryByPath(path string) (*TreeEntry, error)
- func (t Tree) EntryCount() uint64
- func (o *Tree) Free()
- func (o Tree) Id() *Oid
- func (o Tree) Owner() *Repository
- func (o Tree) Type() ObjectType
- func (t Tree) Walk(callback TreeWalkCallback) error
- type TreeBuilder
- type TreeEntry
- type TreeWalkCallback
- type UpdateTipsCallback
Constants ¶
const ( RemoteCompletionDownload RemoteCompletion = C.GIT_REMOTE_COMPLETION_DOWNLOAD RemoteCompletionIndexing RemoteCompletion = C.GIT_REMOTE_COMPLETION_INDEXING RemoteCompletionError RemoteCompletion = C.GIT_REMOTE_COMPLETION_ERROR ConnectDirectionFetch ConnectDirection = C.GIT_DIRECTION_FETCH ConnectDirectionPush ConnectDirection = C.GIT_DIRECTION_PUSH )
Variables ¶
var (
ErrDeltaSkip = errors.New("Skip delta")
)
var (
ErrInvalid = errors.New("Invalid state for operation")
)
Functions ¶
func CallbackGitTreeWalk ¶
func ConfigFindGlobal ¶
func ConfigFindSystem ¶
func ConfigFindXDG ¶
func IsErrorClass ¶
func IsErrorClass(err error, c ErrorClass) bool
func IsErrorCode ¶
func MakeGitError ¶
func MakeGitError2 ¶
func MwindowMappedLimit ¶
func MwindowSize ¶
func RemoteIsValidName ¶
func SearchPath ¶
func SearchPath(level ConfigLevel) (string, error)
func SetMwindowMappedLimit ¶
func SetMwindowSize ¶
func SetSearchPath ¶
func SetSearchPath(level ConfigLevel, path string) error
Types ¶
type AnnotatedCommit ¶
type AnnotatedCommit struct {
// contains filtered or unexported fields
}
func (*AnnotatedCommit) Free ¶
func (mh *AnnotatedCommit) Free()
type BlameOptions ¶
type BlameOptions struct { Flags BlameOptionsFlag MinMatchCharacters uint16 NewestCommit *Oid OldestCommit *Oid MinLine uint32 MaxLine uint32 }
func DefaultBlameOptions ¶
func DefaultBlameOptions() (BlameOptions, error)
type BlameOptionsFlag ¶
type BlameOptionsFlag uint32
const ( BlameNormal BlameOptionsFlag = C.GIT_BLAME_NORMAL BlameTrackCopiesSameFile BlameOptionsFlag = C.GIT_BLAME_TRACK_COPIES_SAME_FILE BlameTrackCopiesSameCommitMoves BlameOptionsFlag = C.GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES BlameTrackCopiesSameCommitCopies BlameOptionsFlag = C.GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES BlameTrackCopiesAnyCommitCopies BlameOptionsFlag = C.GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES BlameFirstParent BlameOptionsFlag = C.GIT_BLAME_FIRST_PARENT )
type Blob ¶
type Blob struct {
// contains filtered or unexported fields
}
func (Blob) Owner ¶
func (o Blob) Owner() *Repository
Owner returns a weak reference to the repository which owns this object
func (Blob) Type ¶
func (o Blob) Type() ObjectType
type BlobCallbackData ¶
type BlobCallbackData struct { Callback BlobChunkCallback Error error }
type BlobChunkCallback ¶
type BranchIterator ¶
type BranchIterator struct {
// contains filtered or unexported fields
}
func (*BranchIterator) ForEach ¶
func (i *BranchIterator) ForEach(f BranchIteratorFunc) error
func (*BranchIterator) Free ¶
func (i *BranchIterator) Free()
func (*BranchIterator) Next ¶
func (i *BranchIterator) Next() (*Branch, BranchType, error)
type BranchIteratorFunc ¶
type BranchIteratorFunc func(*Branch, BranchType) error
type BranchType ¶
type BranchType uint
const ( BranchLocal BranchType = C.GIT_BRANCH_LOCAL BranchRemote BranchType = C.GIT_BRANCH_REMOTE )
type Certificate ¶
type Certificate struct { Kind CertificateKind X509 *x509.Certificate Hostkey HostkeyCertificate }
Certificate represents the two possible certificates which libgit2 knows it might find. If Kind is CertficateX509 then the X509 field will be filled. If Kind is CertificateHostkey then the Hostkey field will be fille.d
type CertificateCheckCallback ¶
type CertificateCheckCallback func(cert *Certificate, valid bool, hostname string) ErrorCode
type CertificateKind ¶
type CertificateKind uint
const ( CertificateX509 CertificateKind = C.GIT_CERT_X509 CertificateHostkey CertificateKind = C.GIT_CERT_HOSTKEY_LIBSSH2 )
type CheckoutOpts ¶
type CheckoutOpts struct { Strategy CheckoutStrategy // Default will be a dry run DisableFilters bool // Don't apply filters like CRLF conversion DirMode os.FileMode // Default is 0755 FileMode os.FileMode // Default is 0644 or 0755 as dictated by blob FileOpenFlags int // Default is O_CREAT | O_TRUNC | O_WRONLY TargetDirectory string // Alternative checkout path to workdir }
type CheckoutStrategy ¶
type CheckoutStrategy uint
const ( CheckoutNone CheckoutStrategy = C.GIT_CHECKOUT_NONE // Dry run, no actual updates CheckoutSafe CheckoutStrategy = C.GIT_CHECKOUT_SAFE // Allow safe updates that cannot overwrite uncommitted data CheckoutSafeCreate CheckoutStrategy = C.GIT_CHECKOUT_SAFE_CREATE // Allow safe updates plus creation of missing files CheckoutForce CheckoutStrategy = C.GIT_CHECKOUT_FORCE // Allow all updates to force working directory to look like index CheckoutAllowConflicts CheckoutStrategy = C.GIT_CHECKOUT_ALLOW_CONFLICTS // Allow checkout to make safe updates even if conflicts are found CheckoutRemoveUntracked CheckoutStrategy = C.GIT_CHECKOUT_REMOVE_UNTRACKED // Remove untracked files not in index (that are not ignored) CheckoutRemoveIgnored CheckoutStrategy = C.GIT_CHECKOUT_REMOVE_IGNORED // Remove ignored files not in index CheckoutUpdateOnly CheckoutStrategy = C.GIT_CHECKOUT_UPDATE_ONLY // Only update existing files, don't create new ones CheckoutDontUpdateIndex CheckoutStrategy = C.GIT_CHECKOUT_DONT_UPDATE_INDEX // Normally checkout updates index entries as it goes; this stops that CheckoutNoRefresh CheckoutStrategy = C.GIT_CHECKOUT_NO_REFRESH // Don't refresh index/config/etc before doing checkout CheckoutDisablePathspecMatch CheckoutStrategy = C.GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH // Treat pathspec as simple list of exact match file paths CheckoutSkipUnmerged CheckoutStrategy = C.GIT_CHECKOUT_SKIP_UNMERGED // Allow checkout to skip unmerged files (NOT IMPLEMENTED) CheckoutUserOurs CheckoutStrategy = C.GIT_CHECKOUT_USE_OURS // For unmerged files, checkout stage 2 from index (NOT IMPLEMENTED) CheckoutUseTheirs CheckoutStrategy = C.GIT_CHECKOUT_USE_THEIRS // For unmerged files, checkout stage 3 from index (NOT IMPLEMENTED) CheckoutUpdateSubmodules CheckoutStrategy = C.GIT_CHECKOUT_UPDATE_SUBMODULES // Recursively checkout submodules with same options (NOT IMPLEMENTED) CheckoutUpdateSubmodulesIfChanged CheckoutStrategy = C.GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED // Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED) )
type CherrypickOptions ¶
type CherrypickOptions struct { Version uint Mainline uint MergeOpts MergeOptions CheckoutOpts CheckoutOpts }
func DefaultCherrypickOptions ¶
func DefaultCherrypickOptions() (CherrypickOptions, error)
type CloneOptions ¶
type CloneOptions struct { *CheckoutOpts *RemoteCallbacks Bare bool CheckoutBranch string RemoteCreateCallback C.git_remote_create_cb RemoteCreatePayload unsafe.Pointer }
type Commit ¶
type Commit struct {
// contains filtered or unexported fields
}
Commit
func (Commit) Owner ¶
func (o Commit) Owner() *Repository
Owner returns a weak reference to the repository which owns this object
func (*Commit) ParentCount ¶
func (Commit) Type ¶
func (o Commit) Type() ObjectType
type CompletionCallback ¶
type CompletionCallback func(RemoteCompletion) ErrorCode
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func OpenOndisk ¶
OpenOndisk creates a new config instance containing a single on-disk file
func (*Config) AddFile ¶
func (c *Config) AddFile(path string, level ConfigLevel, force bool) error
AddFile adds a file-backed backend to the config object at the specified level.
func (*Config) NewIterator ¶
func (c *Config) NewIterator() (*ConfigIterator, error)
NewIterator creates an iterator over each entry in the configuration
func (*Config) NewIteratorGlob ¶
func (c *Config) NewIteratorGlob(regexp string) (*ConfigIterator, error)
NewIteratorGlob creates an iterator over each entry in the configuration whose name matches the given regular expression
func (*Config) NewMultivarIterator ¶
func (c *Config) NewMultivarIterator(name, regexp string) (*ConfigIterator, error)
func (*Config) OpenLevel ¶
func (c *Config) OpenLevel(parent *Config, level ConfigLevel) (*Config, error)
OpenLevel creates a single-level focused config object from a multi-level one
func (*Config) SetMultivar ¶
type ConfigEntry ¶
type ConfigEntry struct { Name string Value string Level ConfigLevel }
type ConfigIterator ¶
type ConfigIterator struct {
// contains filtered or unexported fields
}
func (*ConfigIterator) Free ¶
func (iter *ConfigIterator) Free()
func (*ConfigIterator) Next ¶
func (iter *ConfigIterator) Next() (*ConfigEntry, error)
Next returns the next entry for this iterator
type ConfigLevel ¶
type ConfigLevel int
const ( // System-wide configuration file; /etc/gitconfig on Linux systems ConfigLevelSystem ConfigLevel = C.GIT_CONFIG_LEVEL_SYSTEM // XDG compatible configuration file; typically ~/.config/git/config ConfigLevelXDG ConfigLevel = C.GIT_CONFIG_LEVEL_XDG // User-specific configuration file (also called Global configuration // file); typically ~/.gitconfig ConfigLevelGlobal ConfigLevel = C.GIT_CONFIG_LEVEL_GLOBAL // Repository specific configuration file; $WORK_DIR/.git/config on // non-bare repos ConfigLevelLocal ConfigLevel = C.GIT_CONFIG_LEVEL_LOCAL // Application specific configuration file; freely defined by applications ConfigLevelApp ConfigLevel = C.GIT_CONFIG_LEVEL_APP // Represents the highest level available config file (i.e. the most // specific config file available that actually is loaded) ConfigLevelHighest ConfigLevel = C.GIT_CONFIG_HIGHEST_LEVEL )
type ConnectDirection ¶
type ConnectDirection uint
type Cred ¶
type Cred struct {
// contains filtered or unexported fields
}
func NewCredDefault ¶
func NewCredSshKey ¶
func NewCredSshKeyFromAgent ¶
func (*Cred) HasUsername ¶
type CredType ¶
type CredType uint
const ( CredTypeUserpassPlaintext CredType = C.GIT_CREDTYPE_USERPASS_PLAINTEXT CredTypeSshKey CredType = C.GIT_CREDTYPE_SSH_KEY CredTypeSshCustom CredType = C.GIT_CREDTYPE_SSH_CUSTOM CredTypeDefault CredType = C.GIT_CREDTYPE_DEFAULT )
type CredentialsCallback ¶
type Delta ¶
type Delta int
const ( DeltaUnmodified Delta = C.GIT_DELTA_UNMODIFIED DeltaAdded Delta = C.GIT_DELTA_ADDED DeltaDeleted Delta = C.GIT_DELTA_DELETED DeltaModified Delta = C.GIT_DELTA_MODIFIED DeltaRenamed Delta = C.GIT_DELTA_RENAMED DeltaCopied Delta = C.GIT_DELTA_COPIED DeltaIgnored Delta = C.GIT_DELTA_IGNORED DeltaUntracked Delta = C.GIT_DELTA_UNTRACKED DeltaTypeChange Delta = C.GIT_DELTA_TYPECHANGE )
type Diff ¶
type Diff struct {
// contains filtered or unexported fields
}
func (*Diff) FindSimilar ¶
func (diff *Diff) FindSimilar(opts *DiffFindOptions) error
func (*Diff) ForEach ¶
func (diff *Diff) ForEach(cbFile DiffForEachFileCallback, detail DiffDetail) error
type DiffDetail ¶
type DiffDetail int
const ( DiffDetailFiles DiffDetail = iota DiffDetailHunks DiffDetailLines )
type DiffFindOptions ¶
type DiffFindOptions struct { Flags DiffFindOptionsFlag RenameThreshold uint16 CopyThreshold uint16 RenameFromRewriteThreshold uint16 BreakRewriteThreshold uint16 RenameLimit uint }
TODO implement git_diff_similarity_metric
func DefaultDiffFindOptions ¶
func DefaultDiffFindOptions() (DiffFindOptions, error)
type DiffFindOptionsFlag ¶
type DiffFindOptionsFlag int
const ( DiffFindByConfig DiffFindOptionsFlag = C.GIT_DIFF_FIND_BY_CONFIG DiffFindRenames DiffFindOptionsFlag = C.GIT_DIFF_FIND_RENAMES DiffFindRenamesFromRewrites DiffFindOptionsFlag = C.GIT_DIFF_FIND_RENAMES_FROM_REWRITES DiffFindCopies DiffFindOptionsFlag = C.GIT_DIFF_FIND_COPIES DiffFindCopiesFromUnmodified DiffFindOptionsFlag = C.GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED DiffFindRewrites DiffFindOptionsFlag = C.GIT_DIFF_FIND_REWRITES DiffFindBreakRewrites DiffFindOptionsFlag = C.GIT_DIFF_BREAK_REWRITES DiffFindAndBreakRewrites DiffFindOptionsFlag = C.GIT_DIFF_FIND_AND_BREAK_REWRITES DiffFindForUntracked DiffFindOptionsFlag = C.GIT_DIFF_FIND_FOR_UNTRACKED DiffFindAll DiffFindOptionsFlag = C.GIT_DIFF_FIND_ALL DiffFindIgnoreLeadingWhitespace DiffFindOptionsFlag = C.GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE DiffFindIgnoreWhitespace DiffFindOptionsFlag = C.GIT_DIFF_FIND_IGNORE_WHITESPACE DiffFindDontIgnoreWhitespace DiffFindOptionsFlag = C.GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE DiffFindExactMatchOnly DiffFindOptionsFlag = C.GIT_DIFF_FIND_EXACT_MATCH_ONLY DiffFindBreakRewritesForRenamesOnly DiffFindOptionsFlag = C.GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY DiffFindRemoveUnmodified DiffFindOptionsFlag = C.GIT_DIFF_FIND_REMOVE_UNMODIFIED )
type DiffFlag ¶
type DiffFlag int
const ( DiffFlagBinary DiffFlag = C.GIT_DIFF_FLAG_BINARY DiffFlagNotBinary DiffFlag = C.GIT_DIFF_FLAG_NOT_BINARY DiffFlagValidOid DiffFlag = C.GIT_DIFF_FLAG_VALID_ID )
type DiffForEachFileCallback ¶
type DiffForEachFileCallback func(DiffDelta, float64) (DiffForEachHunkCallback, error)
type DiffForEachHunkCallback ¶
type DiffForEachHunkCallback func(DiffHunk) (DiffForEachLineCallback, error)
type DiffForEachLineCallback ¶
type DiffLine ¶
type DiffLine struct { Origin DiffLineType OldLineno int NewLineno int NumLines int Content string }
type DiffLineType ¶
type DiffLineType int
const ( DiffLineContext DiffLineType = C.GIT_DIFF_LINE_CONTEXT DiffLineAddition DiffLineType = C.GIT_DIFF_LINE_ADDITION DiffLineDeletion DiffLineType = C.GIT_DIFF_LINE_DELETION DiffLineContextEOFNL DiffLineType = C.GIT_DIFF_LINE_CONTEXT_EOFNL DiffLineAddEOFNL DiffLineType = C.GIT_DIFF_LINE_ADD_EOFNL DiffLineDelEOFNL DiffLineType = C.GIT_DIFF_LINE_DEL_EOFNL DiffLineFileHdr DiffLineType = C.GIT_DIFF_LINE_FILE_HDR DiffLineHunkHdr DiffLineType = C.GIT_DIFF_LINE_HUNK_HDR DiffLineBinary DiffLineType = C.GIT_DIFF_LINE_BINARY )
type DiffNotifyCallback ¶
type DiffOptions ¶
type DiffOptions struct { Flags DiffOptionsFlag IgnoreSubmodules SubmoduleIgnore Pathspec []string NotifyCallback DiffNotifyCallback ContextLines uint32 InterhunkLines uint32 IdAbbrev uint16 MaxSize int OldPrefix string NewPrefix string }
func DefaultDiffOptions ¶
func DefaultDiffOptions() (DiffOptions, error)
type DiffOptionsFlag ¶
type DiffOptionsFlag int
const ( DiffNormal DiffOptionsFlag = C.GIT_DIFF_NORMAL DiffReverse DiffOptionsFlag = C.GIT_DIFF_REVERSE DiffIncludeIgnored DiffOptionsFlag = C.GIT_DIFF_INCLUDE_IGNORED DiffRecurseIgnoredDirs DiffOptionsFlag = C.GIT_DIFF_RECURSE_IGNORED_DIRS DiffIncludeUntracked DiffOptionsFlag = C.GIT_DIFF_INCLUDE_UNTRACKED DiffRecurseUntracked DiffOptionsFlag = C.GIT_DIFF_RECURSE_UNTRACKED_DIRS DiffIncludeUnmodified DiffOptionsFlag = C.GIT_DIFF_INCLUDE_UNMODIFIED DiffIncludeTypeChange DiffOptionsFlag = C.GIT_DIFF_INCLUDE_TYPECHANGE DiffIncludeTypeChangeTrees DiffOptionsFlag = C.GIT_DIFF_INCLUDE_TYPECHANGE_TREES DiffIgnoreFilemode DiffOptionsFlag = C.GIT_DIFF_IGNORE_FILEMODE DiffIgnoreSubmodules DiffOptionsFlag = C.GIT_DIFF_IGNORE_SUBMODULES DiffIgnoreCase DiffOptionsFlag = C.GIT_DIFF_IGNORE_CASE DiffDisablePathspecMatch DiffOptionsFlag = C.GIT_DIFF_DISABLE_PATHSPEC_MATCH DiffSkipBinaryCheck DiffOptionsFlag = C.GIT_DIFF_SKIP_BINARY_CHECK DiffEnableFastUntrackedDirs DiffOptionsFlag = C.GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS DiffForceText DiffOptionsFlag = C.GIT_DIFF_FORCE_TEXT DiffForceBinary DiffOptionsFlag = C.GIT_DIFF_FORCE_BINARY DiffIgnoreWhitespace DiffOptionsFlag = C.GIT_DIFF_IGNORE_WHITESPACE DiffIgnoreWhitespaceChange DiffOptionsFlag = C.GIT_DIFF_IGNORE_WHITESPACE_CHANGE DiffIgnoreWitespaceEol DiffOptionsFlag = C.GIT_DIFF_IGNORE_WHITESPACE_EOL DiffShowUntrackedContent DiffOptionsFlag = C.GIT_DIFF_SHOW_UNTRACKED_CONTENT DiffShowUnmodified DiffOptionsFlag = C.GIT_DIFF_SHOW_UNMODIFIED DiffPatience DiffOptionsFlag = C.GIT_DIFF_PATIENCE DiffMinimal DiffOptionsFlag = C.GIT_DIFF_MINIMAL )
type DiffStats ¶
type DiffStats struct {
// contains filtered or unexported fields
}
func (*DiffStats) FilesChanged ¶
func (*DiffStats) Insertions ¶
type ErrorClass ¶
type ErrorClass int
const ( ErrClassNone ErrorClass = C.GITERR_NONE ErrClassNoMemory ErrorClass = C.GITERR_NOMEMORY ErrClassOs ErrorClass = C.GITERR_OS ErrClassInvalid ErrorClass = C.GITERR_INVALID ErrClassReference ErrorClass = C.GITERR_REFERENCE ErrClassZlib ErrorClass = C.GITERR_ZLIB ErrClassRepository ErrorClass = C.GITERR_REPOSITORY ErrClassConfig ErrorClass = C.GITERR_CONFIG ErrClassRegex ErrorClass = C.GITERR_REGEX ErrClassOdb ErrorClass = C.GITERR_ODB ErrClassIndex ErrorClass = C.GITERR_INDEX ErrClassObject ErrorClass = C.GITERR_OBJECT ErrClassNet ErrorClass = C.GITERR_NET ErrClassTag ErrorClass = C.GITERR_TAG ErrClassTree ErrorClass = C.GITERR_TREE ErrClassIndexer ErrorClass = C.GITERR_INDEXER ErrClassSSL ErrorClass = C.GITERR_SSL ErrClassSubmodule ErrorClass = C.GITERR_SUBMODULE ErrClassThread ErrorClass = C.GITERR_THREAD ErrClassStash ErrorClass = C.GITERR_STASH ErrClassCheckout ErrorClass = C.GITERR_CHECKOUT ErrClassFetchHead ErrorClass = C.GITERR_FETCHHEAD ErrClassMerge ErrorClass = C.GITERR_MERGE ErrClassSsh ErrorClass = C.GITERR_SSH ErrClassFilter ErrorClass = C.GITERR_FILTER ErrClassRevert ErrorClass = C.GITERR_REVERT ErrClassCallback ErrorClass = C.GITERR_CALLBACK )
type ErrorCode ¶
type ErrorCode int
const ( // No error ErrOk ErrorCode = C.GIT_OK // Generic error ErrGeneric ErrorCode = C.GIT_ERROR // Requested object could not be found ErrNotFound ErrorCode = C.GIT_ENOTFOUND // Object exists preventing operation ErrExists ErrorCode = C.GIT_EEXISTS // More than one object matches ErrAmbigious ErrorCode = C.GIT_EAMBIGUOUS // Output buffer too short to hold data ErrBuffs ErrorCode = C.GIT_EBUFS // GIT_EUSER is a special error that is never generated by libgit2 // code. You can return it from a callback (e.g to stop an iteration) // to know that it was generated by the callback and not by libgit2. ErrUser ErrorCode = C.GIT_EUSER // Operation not allowed on bare repository ErrBareRepo ErrorCode = C.GIT_EBAREREPO // HEAD refers to branch with no commits ErrUnbornBranch ErrorCode = C.GIT_EUNBORNBRANCH // Merge in progress prevented operation ErrUnmerged ErrorCode = C.GIT_EUNMERGED // Reference was not fast-forwardable ErrNonFastForward ErrorCode = C.GIT_ENONFASTFORWARD // Name/ref spec was not in a valid format ErrInvalidSpec ErrorCode = C.GIT_EINVALIDSPEC // Merge conflicts prevented operation ErrMergeConflict ErrorCode = C.GIT_EMERGECONFLICT // Lock file prevented operation ErrLocked ErrorCode = C.GIT_ELOCKED // Reference value does not match expected ErrModified ErrorCode = C.GIT_EMODIFIED // Internal only ErrPassthrough ErrorCode = C.GIT_PASSTHROUGH // Signals end of iteration with iterator ErrIterOver ErrorCode = C.GIT_ITEROVER )
type Filemode ¶
type Filemode int
const ( FilemodeTree Filemode = C.GIT_FILEMODE_TREE FilemodeBlob Filemode = C.GIT_FILEMODE_BLOB FilemodeBlobExecutable Filemode = C.GIT_FILEMODE_BLOB_EXECUTABLE FilemodeLink Filemode = C.GIT_FILEMODE_LINK FilemodeCommit Filemode = C.GIT_FILEMODE_COMMIT )
type GitError ¶
type GitError struct { Message string Class ErrorClass Code ErrorCode }
type HostkeyCertificate ¶
type HostkeyCertificate struct { Kind HostkeyKind HashMD5 [16]byte HashSHA1 [20]byte }
Server host key information. If Kind is HostkeyMD5 the MD5 field will be filled. If Kind is HostkeySHA1, then HashSHA1 will be filled.
type HostkeyKind ¶
type HostkeyKind uint
const ( HostkeyMD5 HostkeyKind = C.GIT_CERT_SSH_MD5 HostkeySHA1 HostkeyKind = C.GIT_CERT_SSH_SHA1 )
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
func NewIndex ¶
NewIndex allocates a new index. It won't be associated with any file on the filesystem or repository
func (*Index) Add ¶
func (v *Index) Add(entry *IndexEntry) error
Add adds or replaces the given entry to the index, making a copy of the data
func (*Index) AddAll ¶
func (v *Index) AddAll(pathspecs []string, flags IndexAddOpts, callback IndexMatchedPathCallback) error
func (*Index) AddConflict ¶
func (v *Index) AddConflict(ancestor *IndexEntry, our *IndexEntry, their *IndexEntry) error
func (*Index) CleanupConflicts ¶
func (v *Index) CleanupConflicts()
FIXME: this might return an error
func (*Index) ConflictIterator ¶
func (v *Index) ConflictIterator() (*IndexConflictIterator, error)
func (*Index) EntryByIndex ¶
func (v *Index) EntryByIndex(index uint) (*IndexEntry, error)
func (*Index) EntryCount ¶
func (*Index) GetConflict ¶
func (v *Index) GetConflict(path string) (IndexConflict, error)
func (*Index) HasConflicts ¶
func (*Index) RemoveAll ¶
func (v *Index) RemoveAll(pathspecs []string, callback IndexMatchedPathCallback) error
func (*Index) RemoveByPath ¶
func (*Index) RemoveConflict ¶
func (*Index) UpdateAll ¶
func (v *Index) UpdateAll(pathspecs []string, callback IndexMatchedPathCallback) error
func (*Index) WriteTreeTo ¶
func (v *Index) WriteTreeTo(repo *Repository) (*Oid, error)
type IndexAddOpts ¶
type IndexAddOpts uint
const ( IndexAddDefault IndexAddOpts = C.GIT_INDEX_ADD_DEFAULT IndexAddForce IndexAddOpts = C.GIT_INDEX_ADD_FORCE IndexAddDisablePathspecMatch IndexAddOpts = C.GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH IndexAddCheckPathspec IndexAddOpts = C.GIT_INDEX_ADD_CHECK_PATHSPEC )
type IndexConflict ¶
type IndexConflict struct { Ancestor *IndexEntry Our *IndexEntry Their *IndexEntry }
type IndexConflictIterator ¶
type IndexConflictIterator struct {
// contains filtered or unexported fields
}
func (*IndexConflictIterator) Free ¶
func (v *IndexConflictIterator) Free()
func (*IndexConflictIterator) Index ¶
func (v *IndexConflictIterator) Index() *Index
func (*IndexConflictIterator) Next ¶
func (v *IndexConflictIterator) Next() (IndexConflict, error)
type IndexEntry ¶
type MergeAnalysis ¶
type MergeAnalysis int
const ( MergeAnalysisNone MergeAnalysis = C.GIT_MERGE_ANALYSIS_NONE MergeAnalysisNormal MergeAnalysis = C.GIT_MERGE_ANALYSIS_NORMAL MergeAnalysisUpToDate MergeAnalysis = C.GIT_MERGE_ANALYSIS_UP_TO_DATE MergeAnalysisFastForward MergeAnalysis = C.GIT_MERGE_ANALYSIS_FASTFORWARD MergeAnalysisUnborn MergeAnalysis = C.GIT_MERGE_ANALYSIS_UNBORN )
type MergeFileFavor ¶
type MergeFileFavor int
const ( MergeFileFavorNormal MergeFileFavor = C.GIT_MERGE_FILE_FAVOR_NORMAL MergeFileFavorOurs MergeFileFavor = C.GIT_MERGE_FILE_FAVOR_OURS MergeFileFavorTheirs MergeFileFavor = C.GIT_MERGE_FILE_FAVOR_THEIRS MergeFileFavorUnion MergeFileFavor = C.GIT_MERGE_FILE_FAVOR_UNION )
type MergeFileFlags ¶
type MergeFileFlags int
const ( MergeFileDefault MergeFileFlags = C.GIT_MERGE_FILE_DEFAULT MergeFileStyleMerge MergeFileFlags = C.GIT_MERGE_FILE_STYLE_MERGE MergeFileStyleDiff MergeFileFlags = C.GIT_MERGE_FILE_STYLE_DIFF3 MergeFileStyleSimplifyAlnum MergeFileFlags = C.GIT_MERGE_FILE_SIMPLIFY_ALNUM )
type MergeFileInput ¶
type MergeFileOptions ¶
type MergeFileOptions struct { AncestorLabel string OurLabel string TheirLabel string Favor MergeFileFavor Flags MergeFileFlags }
type MergeFileResult ¶
type MergeFileResult struct { Automergeable bool Path string Mode uint Contents []byte // contains filtered or unexported fields }
func MergeFile ¶
func MergeFile(ancestor MergeFileInput, ours MergeFileInput, theirs MergeFileInput, options *MergeFileOptions) (*MergeFileResult, error)
func (*MergeFileResult) Free ¶
func (r *MergeFileResult) Free()
type MergeOptions ¶
type MergeOptions struct { Version uint Flags MergeTreeFlag RenameThreshold uint TargetLimit uint FileFavor MergeFileFavor }
func DefaultMergeOptions ¶
func DefaultMergeOptions() (MergeOptions, error)
type MergePreference ¶
type MergePreference int
const ( MergePreferenceNone MergePreference = C.GIT_MERGE_PREFERENCE_NONE MergePreferenceNoFastForward MergePreference = C.GIT_MERGE_PREFERENCE_NO_FASTFORWARD MergePreferenceFastForwardOnly MergePreference = C.GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY )
type MergeTreeFlag ¶
type MergeTreeFlag int
const (
MergeTreeFindRenames MergeTreeFlag = C.GIT_MERGE_TREE_FIND_RENAMES
)
type Note ¶
type Note struct {
// contains filtered or unexported fields
}
Note
type NoteIterator ¶
type NoteIterator struct {
// contains filtered or unexported fields
}
NoteIterator
func (*NoteIterator) Next ¶
func (it *NoteIterator) Next() (noteId, annotatedId *Oid, err error)
Next returns the current item (note id & annotated id) and advances the iterator internally to the next item
type Object ¶
type Object interface { Free() Id() *Oid Type() ObjectType Owner() *Repository }
type ObjectType ¶
type ObjectType int
const ( ObjectAny ObjectType = C.GIT_OBJ_ANY ObjectBad ObjectType = C.GIT_OBJ_BAD ObjectCommit ObjectType = C.GIT_OBJ_COMMIT ObjectTree ObjectType = C.GIT_OBJ_TREE ObjectBlob ObjectType = C.GIT_OBJ_BLOB ObjectTag ObjectType = C.GIT_OBJ_TAG )
func (ObjectType) String ¶
func (t ObjectType) String() string
type Odb ¶
type Odb struct {
// contains filtered or unexported fields
}
func (*Odb) AddBackend ¶
func (v *Odb) AddBackend(backend *OdbBackend, priority int) (err error)
func (*Odb) ForEach ¶
func (v *Odb) ForEach(callback OdbForEachCallback) error
func (*Odb) Hash ¶
func (v *Odb) Hash(data []byte, otype ObjectType) (oid *Oid, err error)
Hash determines the object-ID (sha1) of a data buffer.
func (*Odb) NewReadStream ¶
func (v *Odb) NewReadStream(id *Oid) (*OdbReadStream, error)
NewReadStream opens a read stream from the ODB. Reading from it will give you the contents of the object.
func (*Odb) NewWriteStream ¶
func (v *Odb) NewWriteStream(size int, otype ObjectType) (*OdbWriteStream, error)
NewWriteStream opens a write stream to the ODB, which allows you to create a new object in the database. The size and type must be known in advance
type OdbBackend ¶
type OdbBackend struct {
// contains filtered or unexported fields
}
func NewOdbBackendFromC ¶
func NewOdbBackendFromC(ptr *C.git_odb_backend) (backend *OdbBackend)
func (*OdbBackend) Free ¶
func (v *OdbBackend) Free()
type OdbForEachCallback ¶
type OdbReadStream ¶
type OdbReadStream struct {
// contains filtered or unexported fields
}
func (*OdbReadStream) Close ¶
func (stream *OdbReadStream) Close() error
Close is a dummy function in order to implement the Closer and ReadCloser interfaces
func (*OdbReadStream) Free ¶
func (stream *OdbReadStream) Free()
type OdbWriteStream ¶
type OdbWriteStream struct { Id Oid // contains filtered or unexported fields }
func (*OdbWriteStream) Close ¶
func (stream *OdbWriteStream) Close() error
Close signals that all the data has been written and stores the resulting object id in the stream's Id field.
func (*OdbWriteStream) Free ¶
func (stream *OdbWriteStream) Free()
type Packbuilder ¶
type Packbuilder struct {
// contains filtered or unexported fields
}
func (*Packbuilder) ForEach ¶
func (pb *Packbuilder) ForEach(callback PackbuilderForeachCallback) error
ForEach repeatedly calls the callback with new packfile data until there is no more data or the callback returns an error
func (*Packbuilder) Free ¶
func (pb *Packbuilder) Free()
func (*Packbuilder) InsertCommit ¶
func (pb *Packbuilder) InsertCommit(id *Oid) error
func (*Packbuilder) InsertTree ¶
func (pb *Packbuilder) InsertTree(id *Oid) error
func (*Packbuilder) ObjectCount ¶
func (pb *Packbuilder) ObjectCount() uint32
func (*Packbuilder) WriteToFile ¶
func (pb *Packbuilder) WriteToFile(name string, mode os.FileMode) error
func (*Packbuilder) Written ¶
func (pb *Packbuilder) Written() uint32
type PushOptions ¶
type PushOptions struct {
PbParallelism uint
}
type Refdb ¶
type Refdb struct {
// contains filtered or unexported fields
}
func (*Refdb) SetBackend ¶
func (v *Refdb) SetBackend(backend *RefdbBackend) (err error)
type RefdbBackend ¶
type RefdbBackend struct {
// contains filtered or unexported fields
}
func NewRefdbBackendFromC ¶
func NewRefdbBackendFromC(ptr *C.git_refdb_backend) (backend *RefdbBackend)
func (*RefdbBackend) Free ¶
func (v *RefdbBackend) Free()
type Reference ¶
type Reference struct {
// contains filtered or unexported fields
}
func (*Reference) Cmp ¶
Cmp compares both references, retursn 0 on equality, otherwise a stable sorting.
func (*Reference) Owner ¶
func (v *Reference) Owner() *Repository
Owner returns a weak reference to the repository which owns this reference.
func (*Reference) SetSymbolicTarget ¶
func (*Reference) SymbolicTarget ¶
func (*Reference) Type ¶
func (v *Reference) Type() ReferenceType
type ReferenceIterator ¶
type ReferenceIterator struct {
// contains filtered or unexported fields
}
func (*ReferenceIterator) Names ¶
func (i *ReferenceIterator) Names() *ReferenceNameIterator
func (*ReferenceIterator) Next ¶
func (v *ReferenceIterator) Next() (*Reference, error)
Next retrieves the next reference. If the iterationis over, the returned error is git.ErrIterOver
type ReferenceNameIterator ¶
type ReferenceNameIterator struct {
*ReferenceIterator
}
func (*ReferenceNameIterator) Next ¶
func (v *ReferenceNameIterator) Next() (string, error)
NextName retrieves the next reference name. If the iteration is over, the returned error is git.ErrIterOver
type ReferenceType ¶
type ReferenceType int
const ( ReferenceSymbolic ReferenceType = C.GIT_REF_SYMBOLIC ReferenceOid ReferenceType = C.GIT_REF_OID )
type Remote ¶
type Remote struct {
// contains filtered or unexported fields
}
func (*Remote) ClearRefspecs ¶
func (o *Remote) ClearRefspecs()
func (*Remote) Connect ¶
func (o *Remote) Connect(direction ConnectDirection) error
func (*Remote) ConnectFetch ¶
func (*Remote) ConnectPush ¶
func (*Remote) Fetch ¶
Fetch performs a fetch operation. refspecs specifies which refspecs to use for this fetch, use an empty list to use the refspecs from the configuration; sig and msg specify what to use for the reflog entries. Leave nil and "" to use defaults.
func (*Remote) FetchRefspecs ¶
func (*Remote) Owner ¶
func (o *Remote) Owner() Repository
func (*Remote) PushRefspecs ¶
func (*Remote) RefspecCount ¶
func (*Remote) SetCallbacks ¶
func (r *Remote) SetCallbacks(callbacks *RemoteCallbacks) error
func (*Remote) SetFetchRefspecs ¶
func (*Remote) SetPushRefspecs ¶
func (*Remote) SetPushUrl ¶
func (*Remote) SetUpdateFetchHead ¶
func (*Remote) UpdateFetchHead ¶
type RemoteCallbacks ¶
type RemoteCallbacks struct { SidebandProgressCallback TransportMessageCallback CompletionCallback CredentialsCallback TransferProgressCallback UpdateTipsCallback CertificateCheckCallback PackProgressCallback PackbuilderProgressCallback PushTransferProgressCallback PushUpdateReferenceCallback }
type RemoteCompletion ¶
type RemoteCompletion uint
type RemoteHead ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository
func Clone ¶
func Clone(url string, path string, options *CloneOptions) (*Repository, error)
func InitRepository ¶
func InitRepository(path string, isbare bool) (*Repository, error)
func NewRepositoryWrapOdb ¶
func NewRepositoryWrapOdb(odb *Odb) (repo *Repository, err error)
func OpenRepository ¶
func OpenRepository(path string) (*Repository, error)
func OpenRepositoryExtended ¶
func OpenRepositoryExtended(path string) (*Repository, error)
func (*Repository) AddSubmodule ¶
func (repo *Repository) AddSubmodule(url, path string, use_git_link bool) (*Submodule, error)
func (*Repository) AheadBehind ¶
func (repo *Repository) AheadBehind(local, upstream *Oid) (ahead, behind int, err error)
func (*Repository) AnnotatedCommitFromFetchHead ¶
func (r *Repository) AnnotatedCommitFromFetchHead(branchName string, remoteURL string, oid *Oid) (*AnnotatedCommit, error)
func (*Repository) AnnotatedCommitFromRef ¶
func (r *Repository) AnnotatedCommitFromRef(ref *Reference) (*AnnotatedCommit, error)
func (*Repository) BlameFile ¶
func (v *Repository) BlameFile(path string, opts *BlameOptions) (*Blame, error)
func (*Repository) CheckoutHead ¶
func (v *Repository) CheckoutHead(opts *CheckoutOpts) error
Updates files in the index and the working tree to match the content of the commit pointed at by HEAD. opts may be nil.
func (*Repository) CheckoutIndex ¶
func (v *Repository) CheckoutIndex(index *Index, opts *CheckoutOpts) error
Updates files in the working tree to match the content of the given index. If index is nil, the repository's index will be used. opts may be nil.
func (*Repository) CheckoutTree ¶
func (v *Repository) CheckoutTree(tree *Tree, opts *CheckoutOpts) error
func (*Repository) Cherrypick ¶
func (v *Repository) Cherrypick(commit *Commit, opts CherrypickOptions) error
func (*Repository) Config ¶
func (v *Repository) Config() (*Config, error)
func (*Repository) CreateAnonymousRemote ¶
func (repo *Repository) CreateAnonymousRemote(url, fetch string) (*Remote, error)
func (*Repository) CreateBlobFromBuffer ¶
func (repo *Repository) CreateBlobFromBuffer(data []byte) (*Oid, error)
func (*Repository) CreateBlobFromChunks ¶
func (repo *Repository) CreateBlobFromChunks(hintPath string, callback BlobChunkCallback) (*Oid, error)
func (*Repository) CreateBranch ¶
func (*Repository) CreateCommit ¶
func (*Repository) CreateNote ¶
func (v *Repository) CreateNote( ref string, author, committer *Signature, id *Oid, note string, force bool) (*Oid, error)
CreateNote adds a note for an object
func (*Repository) CreateReference ¶
func (*Repository) CreateRemote ¶
func (repo *Repository) CreateRemote(name string, url string) (*Remote, error)
func (*Repository) CreateRemoteWithFetchspec ¶
func (*Repository) CreateSymbolicReference ¶
func (*Repository) DefaultNoteRef ¶
func (v *Repository) DefaultNoteRef() (string, error)
DefaultNoteRef returns the default notes reference for a repository
func (*Repository) DefaultSignature ¶
func (repo *Repository) DefaultSignature() (*Signature, error)
func (*Repository) DeleteRemote ¶
func (repo *Repository) DeleteRemote(name string) error
func (*Repository) DescendantOf ¶
func (repo *Repository) DescendantOf(commit, ancestor *Oid) (bool, error)
func (*Repository) DiffIndexToWorkdir ¶
func (v *Repository) DiffIndexToWorkdir(index *Index, opts *DiffOptions) (*Diff, error)
func (*Repository) DiffTreeToTree ¶
func (v *Repository) DiffTreeToTree(oldTree, newTree *Tree, opts *DiffOptions) (*Diff, error)
func (*Repository) DiffTreeToWorkdir ¶
func (v *Repository) DiffTreeToWorkdir(oldTree *Tree, opts *DiffOptions) (*Diff, error)
func (*Repository) DiffTreeToWorkdirWithIndex ¶
func (v *Repository) DiffTreeToWorkdirWithIndex(oldTree *Tree, opts *DiffOptions) (*Diff, error)
func (*Repository) DwimReference ¶
func (v *Repository) DwimReference(name string) (*Reference, error)
DwimReference looks up a reference by DWIMing its short name
func (*Repository) EnsureLog ¶
func (v *Repository) EnsureLog(name string) error
EnsureLog ensures that there is a reflog for the given reference name and creates an empty one if necessary.
func (*Repository) ForeachSubmodule ¶
func (repo *Repository) ForeachSubmodule(cbk SubmoduleCbk) error
func (*Repository) Free ¶
func (v *Repository) Free()
func (*Repository) HasLog ¶
func (v *Repository) HasLog(name string) (bool, error)
HasLog returns whether there is a reflog for the given reference name
func (*Repository) Head ¶
func (v *Repository) Head() (*Reference, error)
func (*Repository) Index ¶
func (v *Repository) Index() (*Index, error)
func (*Repository) IsBare ¶
func (repo *Repository) IsBare() bool
func (*Repository) ListRemotes ¶
func (repo *Repository) ListRemotes() ([]string, error)
func (*Repository) LookupAnnotatedCommit ¶
func (r *Repository) LookupAnnotatedCommit(oid *Oid) (*AnnotatedCommit, error)
func (*Repository) LookupBlob ¶
func (v *Repository) LookupBlob(id *Oid) (*Blob, error)
func (*Repository) LookupBranch ¶
func (repo *Repository) LookupBranch(branchName string, bt BranchType) (*Branch, error)
func (*Repository) LookupCommit ¶
func (v *Repository) LookupCommit(id *Oid) (*Commit, error)
func (*Repository) LookupReference ¶
func (v *Repository) LookupReference(name string) (*Reference, error)
func (*Repository) LookupRemote ¶
func (repo *Repository) LookupRemote(name string) (*Remote, error)
func (*Repository) LookupSubmodule ¶
func (repo *Repository) LookupSubmodule(name string) (*Submodule, error)
func (*Repository) LookupTree ¶
func (v *Repository) LookupTree(id *Oid) (*Tree, error)
func (*Repository) Merge ¶
func (r *Repository) Merge(theirHeads []*AnnotatedCommit, mergeOptions *MergeOptions, checkoutOptions *CheckoutOpts) error
func (*Repository) MergeAnalysis ¶
func (r *Repository) MergeAnalysis(theirHeads []*AnnotatedCommit) (MergeAnalysis, MergePreference, error)
func (*Repository) MergeCommits ¶
func (r *Repository) MergeCommits(ours *Commit, theirs *Commit, options *MergeOptions) (*Index, error)
func (*Repository) MergeTrees ¶
func (r *Repository) MergeTrees(ancestor *Tree, ours *Tree, theirs *Tree, options *MergeOptions) (*Index, error)
func (*Repository) NewBranchIterator ¶
func (repo *Repository) NewBranchIterator(flags BranchType) (*BranchIterator, error)
func (*Repository) NewNoteIterator ¶
func (repo *Repository) NewNoteIterator(ref string) (*NoteIterator, error)
NewNoteIterator creates a new iterator for notes
func (*Repository) NewPackbuilder ¶
func (repo *Repository) NewPackbuilder() (*Packbuilder, error)
func (*Repository) NewRefdb ¶
func (v *Repository) NewRefdb() (refdb *Refdb, err error)
func (*Repository) NewReferenceIterator ¶
func (repo *Repository) NewReferenceIterator() (*ReferenceIterator, error)
NewReferenceIterator creates a new iterator over reference names
func (*Repository) NewReferenceIteratorGlob ¶
func (repo *Repository) NewReferenceIteratorGlob(glob string) (*ReferenceIterator, error)
NewReferenceIteratorGlob creates an iterator over reference names that match the speicified glob. The glob is of the usual fnmatch type.
func (*Repository) NewReferenceNameIterator ¶
func (repo *Repository) NewReferenceNameIterator() (*ReferenceNameIterator, error)
NewReferenceIterator creates a new branch iterator over reference names
func (*Repository) Odb ¶
func (v *Repository) Odb() (odb *Odb, err error)
func (*Repository) PatchFromBuffers ¶
func (v *Repository) PatchFromBuffers(oldPath, newPath string, oldBuf, newBuf []byte, opts *DiffOptions) (*Patch, error)
func (*Repository) Path ¶
func (repo *Repository) Path() string
func (*Repository) ReadNote ¶
func (v *Repository) ReadNote(ref string, id *Oid) (*Note, error)
ReadNote reads the note for an object
func (*Repository) ReloadAllSubmodules ¶
func (repo *Repository) ReloadAllSubmodules(force bool) error
func (*Repository) RemoteName ¶
func (repo *Repository) RemoteName(canonicalBranchName string) (string, error)
func (*Repository) RemoveNote ¶
func (v *Repository) RemoveNote(ref string, author, committer *Signature, id *Oid) error
RemoveNote removes the note for an object
func (*Repository) RevparseExt ¶
func (r *Repository) RevparseExt(spec string) (Object, *Reference, error)
func (*Repository) RevparseSingle ¶
func (v *Repository) RevparseSingle(spec string) (Object, error)
func (*Repository) SetHead ¶
func (v *Repository) SetHead(refname string, sig *Signature, msg string) error
func (*Repository) SetHeadDetached ¶
func (v *Repository) SetHeadDetached(id *Oid, sig *Signature, msg string) error
func (*Repository) SetRefdb ¶
func (v *Repository) SetRefdb(refdb *Refdb)
func (*Repository) SetWorkdir ¶
func (repo *Repository) SetWorkdir(workdir string, updateGitlink bool) error
func (*Repository) State ¶
func (r *Repository) State() RepositoryState
func (*Repository) StateCleanup ¶
func (r *Repository) StateCleanup() error
func (*Repository) StatusFile ¶
func (v *Repository) StatusFile(path string) (Status, error)
func (*Repository) StatusList ¶
func (v *Repository) StatusList(opts *StatusOptions) (*StatusList, error)
func (*Repository) TreeBuilder ¶
func (v *Repository) TreeBuilder() (*TreeBuilder, error)
func (*Repository) TreeBuilderFromTree ¶
func (v *Repository) TreeBuilderFromTree(tree *Tree) (*TreeBuilder, error)
func (*Repository) UpstreamName ¶
func (repo *Repository) UpstreamName(canonicalBranchName string) (string, error)
func (*Repository) Walk ¶
func (v *Repository) Walk() (*RevWalk, error)
func (*Repository) Workdir ¶
func (repo *Repository) Workdir() string
type RepositoryState ¶
type RepositoryState int
const ( RepositoryStateNone RepositoryState = C.GIT_REPOSITORY_STATE_NONE RepositoryStateMerge RepositoryState = C.GIT_REPOSITORY_STATE_MERGE RepositoryStateRevert RepositoryState = C.GIT_REPOSITORY_STATE_REVERT RepositoryStateCherrypick RepositoryState = C.GIT_REPOSITORY_STATE_CHERRYPICK RepositoryStateBisect RepositoryState = C.GIT_REPOSITORY_STATE_BISECT RepositoryStateRebase RepositoryState = C.GIT_REPOSITORY_STATE_REBASE RepositoryStateRebaseInteractive RepositoryState = C.GIT_REPOSITORY_STATE_REBASE_INTERACTIVE RepositoryStateRebaseMerge RepositoryState = C.GIT_REPOSITORY_STATE_REBASE_MERGE RepositoryStateApplyMailbox RepositoryState = C.GIT_REPOSITORY_STATE_APPLY_MAILBOX RepositoryStateApplyMailboxOrRebase RepositoryState = C.GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE )
type RevWalk ¶
type RevWalk struct {
// contains filtered or unexported fields
}
func (*RevWalk) Iterate ¶
func (v *RevWalk) Iterate(fun RevWalkIterator) (err error)
type RevWalkIterator ¶
type RevparseFlag ¶
type RevparseFlag int
const ( RevparseSingle RevparseFlag = C.GIT_REVPARSE_SINGLE RevparseRange RevparseFlag = C.GIT_REVPARSE_RANGE RevparseMergeBase RevparseFlag = C.GIT_REVPARSE_MERGE_BASE )
type Revspec ¶
type Revspec struct {
// contains filtered or unexported fields
}
func (*Revspec) Flags ¶
func (rs *Revspec) Flags() RevparseFlag
type SortType ¶
type SortType uint
const ( SortNone SortType = C.GIT_SORT_NONE SortTopological SortType = C.GIT_SORT_TOPOLOGICAL SortTime SortType = C.GIT_SORT_TIME SortReverse SortType = C.GIT_SORT_REVERSE )
type Status ¶
type Status int
const ( StatusCurrent Status = C.GIT_STATUS_CURRENT StatusIndexNew Status = C.GIT_STATUS_INDEX_NEW StatusIndexModified Status = C.GIT_STATUS_INDEX_MODIFIED StatusIndexDeleted Status = C.GIT_STATUS_INDEX_DELETED StatusIndexRenamed Status = C.GIT_STATUS_INDEX_RENAMED StatusIndexTypeChange Status = C.GIT_STATUS_INDEX_TYPECHANGE StatusWtNew Status = C.GIT_STATUS_WT_NEW StatusWtModified Status = C.GIT_STATUS_WT_MODIFIED StatusWtDeleted Status = C.GIT_STATUS_WT_DELETED StatusWtTypeChange Status = C.GIT_STATUS_WT_TYPECHANGE StatusWtRenamed Status = C.GIT_STATUS_WT_RENAMED StatusIgnored Status = C.GIT_STATUS_IGNORED )
type StatusEntry ¶
type StatusList ¶
type StatusList struct {
// contains filtered or unexported fields
}
func (*StatusList) ByIndex ¶
func (statusList *StatusList) ByIndex(index int) (StatusEntry, error)
func (*StatusList) EntryCount ¶
func (statusList *StatusList) EntryCount() (int, error)
func (*StatusList) Free ¶
func (statusList *StatusList) Free()
type StatusOpt ¶
type StatusOpt int
const ( StatusOptIncludeUntracked StatusOpt = C.GIT_STATUS_OPT_INCLUDE_UNTRACKED StatusOptIncludeIgnored StatusOpt = C.GIT_STATUS_OPT_INCLUDE_IGNORED StatusOptIncludeUnmodified StatusOpt = C.GIT_STATUS_OPT_INCLUDE_UNMODIFIED StatusOptExcludeSubmodules StatusOpt = C.GIT_STATUS_OPT_EXCLUDE_SUBMODULES StatusOptRecurseUntrackedDirs StatusOpt = C.GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS StatusOptDisablePathspecMatch StatusOpt = C.GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH StatusOptRecurseIgnoredDirs StatusOpt = C.GIT_STATUS_OPT_RECURSE_IGNORED_DIRS StatusOptRenamesHeadToIndex StatusOpt = C.GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX StatusOptRenamesIndexToWorkdir StatusOpt = C.GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR StatusOptSortCaseSensitively StatusOpt = C.GIT_STATUS_OPT_SORT_CASE_SENSITIVELY StatusOptSortCaseInsensitively StatusOpt = C.GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY StatusOptRenamesFromRewrites StatusOpt = C.GIT_STATUS_OPT_RENAMES_FROM_REWRITES StatusOptNoRefresh StatusOpt = C.GIT_STATUS_OPT_NO_REFRESH StatusOptUpdateIndex StatusOpt = C.GIT_STATUS_OPT_UPDATE_INDEX )
type StatusOptions ¶
type StatusOptions struct { Show StatusShow Flags StatusOpt Pathspec []string }
type StatusShow ¶
type StatusShow int
const ( StatusShowIndexAndWorkdir StatusShow = C.GIT_STATUS_SHOW_INDEX_AND_WORKDIR StatusShowIndexOnly StatusShow = C.GIT_STATUS_SHOW_INDEX_ONLY StatusShowWorkdirOnly StatusShow = C.GIT_STATUS_SHOW_WORKDIR_ONLY )
type Submodule ¶
type Submodule struct {
// contains filtered or unexported fields
}
Submodule
func (*Submodule) AddToIndex ¶
func (*Submodule) FetchRecurseSubmodules ¶
func (sub *Submodule) FetchRecurseSubmodules() SubmoduleRecurse
func (*Submodule) FinalizeAdd ¶
func (*Submodule) Ignore ¶
func (sub *Submodule) Ignore() SubmoduleIgnore
func (*Submodule) Open ¶
func (sub *Submodule) Open() (*Repository, error)
func (*Submodule) Owner ¶
func (sub *Submodule) Owner() *Repository
func (*Submodule) SetFetchRecurseSubmodules ¶
func (sub *Submodule) SetFetchRecurseSubmodules(recurse SubmoduleRecurse) error
func (*Submodule) SetIgnore ¶
func (sub *Submodule) SetIgnore(ignore SubmoduleIgnore) SubmoduleIgnore
func (*Submodule) SetUpdate ¶
func (sub *Submodule) SetUpdate(update SubmoduleUpdate) SubmoduleUpdate
func (*Submodule) Update ¶
func (sub *Submodule) Update(init bool, opts *SubmoduleUpdateOptions) error
func (*Submodule) UpdateStrategy ¶
func (sub *Submodule) UpdateStrategy() SubmoduleUpdate
type SubmoduleCbk ¶
type SubmoduleIgnore ¶
type SubmoduleIgnore int
const ( SubmoduleIgnoreReset SubmoduleIgnore = C.GIT_SUBMODULE_IGNORE_RESET SubmoduleIgnoreNone SubmoduleIgnore = C.GIT_SUBMODULE_IGNORE_NONE SubmoduleIgnoreUntracked SubmoduleIgnore = C.GIT_SUBMODULE_IGNORE_UNTRACKED SubmoduleIgnoreDirty SubmoduleIgnore = C.GIT_SUBMODULE_IGNORE_DIRTY SubmoduleIgnoreAll SubmoduleIgnore = C.GIT_SUBMODULE_IGNORE_ALL )
type SubmoduleRecurse ¶
type SubmoduleRecurse int
const ( SubmoduleRecurseNo SubmoduleRecurse = C.GIT_SUBMODULE_RECURSE_NO SubmoduleRecurseYes SubmoduleRecurse = C.GIT_SUBMODULE_RECURSE_YES SubmoduleRecurseOndemand SubmoduleRecurse = C.GIT_SUBMODULE_RECURSE_ONDEMAND )
type SubmoduleStatus ¶
type SubmoduleStatus int
const ( SubmoduleStatusInHead SubmoduleStatus = C.GIT_SUBMODULE_STATUS_IN_HEAD SubmoduleStatusInIndex SubmoduleStatus = C.GIT_SUBMODULE_STATUS_IN_INDEX SubmoduleStatusInConfig SubmoduleStatus = C.GIT_SUBMODULE_STATUS_IN_CONFIG SubmoduleStatusInWd SubmoduleStatus = C.GIT_SUBMODULE_STATUS_IN_WD SubmoduleStatusIndexAdded SubmoduleStatus = C.GIT_SUBMODULE_STATUS_INDEX_ADDED SubmoduleStatusIndexDeleted SubmoduleStatus = C.GIT_SUBMODULE_STATUS_INDEX_DELETED SubmoduleStatusIndexModified SubmoduleStatus = C.GIT_SUBMODULE_STATUS_INDEX_MODIFIED SubmoduleStatusWdUninitialized SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_UNINITIALIZED SubmoduleStatusWdAdded SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_ADDED SubmoduleStatusWdDeleted SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_DELETED SubmoduleStatusWdModified SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_MODIFIED SubmoduleStatusWdIndexModified SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED SubmoduleStatusWdWdModified SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_WD_MODIFIED SubmoduleStatusWdUntracked SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_UNTRACKED )
type SubmoduleUpdate ¶
type SubmoduleUpdate int
const ( SubmoduleUpdateReset SubmoduleUpdate = C.GIT_SUBMODULE_UPDATE_RESET SubmoduleUpdateCheckout SubmoduleUpdate = C.GIT_SUBMODULE_UPDATE_CHECKOUT SubmoduleUpdateRebase SubmoduleUpdate = C.GIT_SUBMODULE_UPDATE_REBASE SubmoduleUpdateMerge SubmoduleUpdate = C.GIT_SUBMODULE_UPDATE_MERGE SubmoduleUpdateNone SubmoduleUpdate = C.GIT_SUBMODULE_UPDATE_NONE )
type SubmoduleUpdateOptions ¶
type SubmoduleUpdateOptions struct { *CheckoutOpts *RemoteCallbacks CloneCheckoutStrategy CheckoutStrategy Signature *Signature }
SubmoduleUpdateOptions
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
Tag
func (Tag) Owner ¶
func (o Tag) Owner() *Repository
Owner returns a weak reference to the repository which owns this object
func (Tag) TargetType ¶
func (t Tag) TargetType() ObjectType
func (Tag) Type ¶
func (o Tag) Type() ObjectType
type TransferProgress ¶
type TransferProgressCallback ¶
type TransferProgressCallback func(stats TransferProgress) ErrorCode
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
func (Tree) EntryByIndex ¶
func (Tree) EntryByName ¶
func (Tree) EntryByPath ¶
EntryByPath looks up an entry by its full path, recursing into deeper trees if necessary (i.e. if there are slashes in the path)
func (Tree) EntryCount ¶
func (Tree) Owner ¶
func (o Tree) Owner() *Repository
Owner returns a weak reference to the repository which owns this object
func (Tree) Type ¶
func (o Tree) Type() ObjectType
func (Tree) Walk ¶
func (t Tree) Walk(callback TreeWalkCallback) error
type TreeBuilder ¶
type TreeBuilder struct {
// contains filtered or unexported fields
}
func (*TreeBuilder) Free ¶
func (v *TreeBuilder) Free()
func (*TreeBuilder) Insert ¶
func (v *TreeBuilder) Insert(filename string, id *Oid, filemode int) error
func (*TreeBuilder) Remove ¶
func (v *TreeBuilder) Remove(filename string) error
func (*TreeBuilder) Write ¶
func (v *TreeBuilder) Write() (*Oid, error)
type TreeWalkCallback ¶
Source Files ¶
- blame.go
- blob.go
- branch.go
- checkout.go
- cherrypick.go
- clone.go
- commit.go
- config.go
- credentials.go
- diff.go
- git.go
- graph.go
- index.go
- merge.go
- note.go
- object.go
- odb.go
- packbuilder.go
- patch.go
- refdb.go
- reference.go
- remote.go
- repository.go
- revparse.go
- settings.go
- signature.go
- status.go
- submodule.go
- tag.go
- tree.go
- walk.go