diff --git a/diff.go b/diff.go index 565fcee..5b96fac 100644 --- a/diff.go +++ b/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 diff --git a/repository.go b/repository.go index 2e6b81d..f0a2c74 100644 --- a/repository.go +++ b/repository.go @@ -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 diff --git a/status.go b/status.go index 068a474..e68e6e9 100644 --- a/status.go +++ b/status.go @@ -25,6 +25,7 @@ const ( StatusWtTypeChange Status = C.GIT_STATUS_WT_TYPECHANGE StatusWtRenamed Status = C.GIT_STATUS_WT_RENAMED StatusIgnored Status = C.GIT_STATUS_IGNORED + StatusConflicted Status = C.GIT_STATUS_CONFLICTED ) type StatusEntry struct {