Merge pull request #301 from hansrodtang/next
Add some constants and repository methods.
This commit is contained in:
commit
652a14f732
4
diff.go
4
diff.go
|
@ -20,6 +20,7 @@ const (
|
||||||
DiffFlagBinary DiffFlag = C.GIT_DIFF_FLAG_BINARY
|
DiffFlagBinary DiffFlag = C.GIT_DIFF_FLAG_BINARY
|
||||||
DiffFlagNotBinary DiffFlag = C.GIT_DIFF_FLAG_NOT_BINARY
|
DiffFlagNotBinary DiffFlag = C.GIT_DIFF_FLAG_NOT_BINARY
|
||||||
DiffFlagValidOid DiffFlag = C.GIT_DIFF_FLAG_VALID_ID
|
DiffFlagValidOid DiffFlag = C.GIT_DIFF_FLAG_VALID_ID
|
||||||
|
DiffFlagExists DiffFlag = C.GIT_DIFF_FLAG_EXISTS
|
||||||
)
|
)
|
||||||
|
|
||||||
type Delta int
|
type Delta int
|
||||||
|
@ -34,6 +35,8 @@ const (
|
||||||
DeltaIgnored Delta = C.GIT_DELTA_IGNORED
|
DeltaIgnored Delta = C.GIT_DELTA_IGNORED
|
||||||
DeltaUntracked Delta = C.GIT_DELTA_UNTRACKED
|
DeltaUntracked Delta = C.GIT_DELTA_UNTRACKED
|
||||||
DeltaTypeChange Delta = C.GIT_DELTA_TYPECHANGE
|
DeltaTypeChange Delta = C.GIT_DELTA_TYPECHANGE
|
||||||
|
DeltaUnreadable Delta = C.GIT_DELTA_UNREADABLE
|
||||||
|
DeltaConflicted Delta = C.GIT_DELTA_CONFLICTED
|
||||||
)
|
)
|
||||||
|
|
||||||
type DiffLineType int
|
type DiffLineType int
|
||||||
|
@ -372,6 +375,7 @@ const (
|
||||||
DiffIgnoreFilemode DiffOptionsFlag = C.GIT_DIFF_IGNORE_FILEMODE
|
DiffIgnoreFilemode DiffOptionsFlag = C.GIT_DIFF_IGNORE_FILEMODE
|
||||||
DiffIgnoreSubmodules DiffOptionsFlag = C.GIT_DIFF_IGNORE_SUBMODULES
|
DiffIgnoreSubmodules DiffOptionsFlag = C.GIT_DIFF_IGNORE_SUBMODULES
|
||||||
DiffIgnoreCase DiffOptionsFlag = C.GIT_DIFF_IGNORE_CASE
|
DiffIgnoreCase DiffOptionsFlag = C.GIT_DIFF_IGNORE_CASE
|
||||||
|
DiffIncludeCaseChange DiffOptionsFlag = C.GIT_DIFF_INCLUDE_CASECHANGE
|
||||||
|
|
||||||
DiffDisablePathspecMatch DiffOptionsFlag = C.GIT_DIFF_DISABLE_PATHSPEC_MATCH
|
DiffDisablePathspecMatch DiffOptionsFlag = C.GIT_DIFF_DISABLE_PATHSPEC_MATCH
|
||||||
DiffSkipBinaryCheck DiffOptionsFlag = C.GIT_DIFF_SKIP_BINARY_CHECK
|
DiffSkipBinaryCheck DiffOptionsFlag = C.GIT_DIFF_SKIP_BINARY_CHECK
|
||||||
|
|
|
@ -268,6 +268,40 @@ func (v *Repository) IsHeadDetached() (bool, error) {
|
||||||
return ret != 0, nil
|
return ret != 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (v *Repository) IsHeadUnborn() (bool, error) {
|
||||||
|
runtime.LockOSThread()
|
||||||
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
|
ret := C.git_repository_head_unborn(v.ptr)
|
||||||
|
if ret < 0 {
|
||||||
|
return false, MakeGitError(ret)
|
||||||
|
}
|
||||||
|
return ret != 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *Repository) IsEmpty() (bool, error) {
|
||||||
|
runtime.LockOSThread()
|
||||||
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
|
ret := C.git_repository_is_empty(v.ptr)
|
||||||
|
if ret < 0 {
|
||||||
|
return false, MakeGitError(ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret != 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *Repository) IsShallow() (bool, error) {
|
||||||
|
runtime.LockOSThread()
|
||||||
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
|
ret := C.git_repository_is_shallow(v.ptr)
|
||||||
|
if ret < 0 {
|
||||||
|
return false, MakeGitError(ret)
|
||||||
|
}
|
||||||
|
return ret != 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (v *Repository) Walk() (*RevWalk, error) {
|
func (v *Repository) Walk() (*RevWalk, error) {
|
||||||
|
|
||||||
var walkPtr *C.git_revwalk
|
var walkPtr *C.git_revwalk
|
||||||
|
|
|
@ -25,6 +25,7 @@ const (
|
||||||
StatusWtTypeChange Status = C.GIT_STATUS_WT_TYPECHANGE
|
StatusWtTypeChange Status = C.GIT_STATUS_WT_TYPECHANGE
|
||||||
StatusWtRenamed Status = C.GIT_STATUS_WT_RENAMED
|
StatusWtRenamed Status = C.GIT_STATUS_WT_RENAMED
|
||||||
StatusIgnored Status = C.GIT_STATUS_IGNORED
|
StatusIgnored Status = C.GIT_STATUS_IGNORED
|
||||||
|
StatusConflicted Status = C.GIT_STATUS_CONFLICTED
|
||||||
)
|
)
|
||||||
|
|
||||||
type StatusEntry struct {
|
type StatusEntry struct {
|
||||||
|
|
Loading…
Reference in New Issue