go-git: github.com/str1ngs/go-git Index | Files

package git

import "github.com/str1ngs/go-git"

Index

Constants

const (
    NOTBARE = iota
    BARE
    GIT_SUCCESS = 0
)

func GetHeadString

func GetHeadString(repo *Repo) (string, error)

func LastError

func LastError() error

Helper functions

type Commit

type Commit struct {
    // contains filtered or unexported fields
}

Commit

func (*Commit) Author

func (c *Commit) Author() string

func (*Commit) Email

func (c *Commit) Email() string

func (*Commit) Lookup

func (c *Commit) Lookup(r *Repo, o *Oid) (err error)

func (*Commit) Msg

func (c *Commit) Msg() string

type Entry

type Entry struct {
    // contains filtered or unexported fields
}

Entry

func (*Entry) Filename

func (e *Entry) Filename() string

func (*Entry) Oid

func (e *Entry) Oid() *Oid

type Index

type Index struct {
    // contains filtered or unexported fields
}

Index

func NewIndex

func NewIndex(repo *Repo) (*Index, error)

func (*Index) Add

func (v *Index) Add(file string) (err error)

func (*Index) EntryCount

func (v *Index) EntryCount() int

func (*Index) Free

func (v *Index) Free()

func (*Index) Get

func (v *Index) Get(n int) (*IndexEntry, error)

func (*Index) Read

func (v *Index) Read() (err error)

func (*Index) Write

func (v *Index) Write() (err error)

type IndexEntry

type IndexEntry struct {
    // contains filtered or unexported fields
}

func (*IndexEntry) Flags

func (i *IndexEntry) Flags() int

func (*IndexEntry) Oid

func (i *IndexEntry) Oid() *Oid

func (*IndexEntry) Path

func (i *IndexEntry) Path() string

type Oid

type Oid struct {
    // contains filtered or unexported fields
}

Oid

func GetHead

func GetHead(repo *Repo) (*Oid, error)

TODO: do not assume we are working on refs/heads/master

func NewOid

func NewOid() *Oid

func NewOidString

func NewOidString(s string) (*Oid, error)

func TreeFromIndex

func TreeFromIndex(repo *Repo, index *Index) (*Oid, error)

func (*Oid) String

func (v *Oid) String() string

type Reference

type Reference struct {
    // contains filtered or unexported fields
}

Reference

func (*Reference) GetOid

func (v *Reference) GetOid() (*Oid, error)

func (*Reference) Lookup

func (v *Reference) Lookup(r *Repo, name string) (err error)

func (*Reference) SetTarget

func (v *Reference) SetTarget(target string) (err error)

func (*Reference) Type

func (v *Reference) Type()

type Repo

type Repo struct {
    // contains filtered or unexported fields
}

Repo

func (*Repo) Free

func (v *Repo) Free()

func (*Repo) Init

func (v *Repo) Init(path string, isbare uint8) (err error)

func (*Repo) Open

func (v *Repo) Open(path string) (err error)

type RevWalk

type RevWalk struct {
    // contains filtered or unexported fields
}

RevWalk

func NewRevWalk

func NewRevWalk(repo *Repo) (*RevWalk, error)

func (*RevWalk) Free

func (v *RevWalk) Free()

func (*RevWalk) Next

func (v *RevWalk) Next(o *Oid) (err error)

TODO: end of walk produces a LastError figure out how to reset it and return a os.EOF instead possibly return a Oid? Would make for less boiler plate.

func (*RevWalk) Push

func (v *RevWalk) Push(o *Oid)

func (*RevWalk) Reset

func (v *RevWalk) Reset()

func (*RevWalk) Sorting

func (v *RevWalk) Sorting(sm uint)

TODO: implement this

type Signature

type Signature struct {
    // contains filtered or unexported fields
}

TODO: its possible we can use godef to generate this struct Signature

func NewSignature

func NewSignature(name, email string) *Signature

func (Signature) Free

func (s Signature) Free()

type Test

type Test *C.git_repository

type Tree

type Tree struct {
    // contains filtered or unexported fields
}

Tree

func TreeFromCommit

func TreeFromCommit(repo *Repo, commit *Commit) (*Tree, error)

func TreeLookup

func TreeLookup(repo *Repo, oid *Oid) (*Tree, error)

func (*Tree) EntryByIndex

func (t *Tree) EntryByIndex(index int) (*Entry, error)

func (*Tree) EntryByName

func (t *Tree) EntryByName(filename string) (*Entry, error)

func (*Tree) EntryCount

func (t *Tree) EntryCount() int

func (*Tree) Free

func (t *Tree) Free()

Files

git.go

Package git imports 5 packages (graph). Updated 2013-04-12. Refresh.