Add some constants and repository methods. #301
4
diff.go
4
diff.go
|
@ -20,6 +20,7 @@ const (
|
|||
DiffFlagBinary DiffFlag = C.GIT_DIFF_FLAG_BINARY
|
||||
DiffFlagNotBinary DiffFlag = C.GIT_DIFF_FLAG_NOT_BINARY
|
||||
DiffFlagValidOid DiffFlag = C.GIT_DIFF_FLAG_VALID_ID
|
||||
DiffFlagExists DiffFlag = C.GIT_DIFF_FLAG_EXISTS
|
||||
)
|
||||
|
||||
type Delta int
|
||||
|
@ -34,6 +35,8 @@ const (
|
|||
DeltaIgnored Delta = C.GIT_DELTA_IGNORED
|
||||
DeltaUntracked Delta = C.GIT_DELTA_UNTRACKED
|
||||
DeltaTypeChange Delta = C.GIT_DELTA_TYPECHANGE
|
||||
DeltaUnreadable Delta = C.GIT_DELTA_UNREADABLE
|
||||
DeltaConflicted Delta = C.GIT_DELTA_CONFLICTED
|
||||
)
|
||||
|
||||
type DiffLineType int
|
||||
|
@ -372,6 +375,7 @@ const (
|
|||
DiffIgnoreFilemode DiffOptionsFlag = C.GIT_DIFF_IGNORE_FILEMODE
|
||||
DiffIgnoreSubmodules DiffOptionsFlag = C.GIT_DIFF_IGNORE_SUBMODULES
|
||||
DiffIgnoreCase DiffOptionsFlag = C.GIT_DIFF_IGNORE_CASE
|
||||
DiffIncludeCaseChange DiffOptionsFlag = C.GIT_DIFF_INCLUDE_CASECHANGE
|
||||
|
||||
DiffDisablePathspecMatch DiffOptionsFlag = C.GIT_DIFF_DISABLE_PATHSPEC_MATCH
|
||||
DiffSkipBinaryCheck DiffOptionsFlag = C.GIT_DIFF_SKIP_BINARY_CHECK
|
||||
|
|
|
@ -268,6 +268,40 @@ func (v *Repository) IsHeadDetached() (bool, error) {
|
|||
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) {
|
||||
|
||||
var walkPtr *C.git_revwalk
|
||||
|
|
Loading…
Reference in New Issue