diff --git a/git.go b/git.go index d6b7dc0..2afbfaa 100644 --- a/git.go +++ b/git.go @@ -50,31 +50,43 @@ const ( type ErrorCode int const ( - ErrOk ErrorCode = C.GIT_OK /*< No error */ - ErrGeneric = C.GIT_ERROR /*< Generic error */ - ErrNotFound = C.GIT_ENOTFOUND /*< Requested object could not be found */ - ErrExists = C.GIT_EEXISTS /*< Object exists preventing operation */ - ErrAmbigious = C.GIT_EAMBIGUOUS /*< More than one object matches */ - ErrBuffs = C.GIT_EBUFS /*< Output buffer too short to hold data */ - - /* 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. - */ + // No error + ErrOk ErrorCode = C.GIT_OK + // Generic error + ErrGeneric = C.GIT_ERROR + // Requested object could not be found + ErrNotFound = C.GIT_ENOTFOUND + // Object exists preventing operation + ErrExists = C.GIT_EEXISTS + // More than one object matches + ErrAmbigious = C.GIT_EAMBIGUOUS + // Output buffer too short to hold data + ErrBuffs = 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 = C.GIT_EUSER - - ErrBareRepo = C.GIT_EBAREREPO /*< Operation not allowed on bare repository */ - ErrUnbornBranch = C.GIT_EUNBORNBRANCH /*< HEAD refers to branch with no commits */ - ErrUnmerged = C.GIT_EUNMERGED /*< Merge in progress prevented operation */ - ErrNonFastForward = C.GIT_ENONFASTFORWARD /*< Reference was not fast-forwardable */ - ErrInvalidSpec = C.GIT_EINVALIDSPEC /*< Name/ref spec was not in a valid format */ - ErrMergeConflict = C.GIT_EMERGECONFLICT /*< Merge conflicts prevented operation */ - ErrLocked = C.GIT_ELOCKED /*< Lock file prevented operation */ - ErrModified = C.GIT_EMODIFIED /*< Reference value does not match expected */ - - ErrPassthrough = C.GIT_PASSTHROUGH /*< Internal only */ - ErrIterOver = C.GIT_ITEROVER /*< Signals end of iteration with iterator */ + // Operation not allowed on bare repository + ErrBareRepo = C.GIT_EBAREREPO + // HEAD refers to branch with no commits + ErrUnbornBranch = C.GIT_EUNBORNBRANCH + // Merge in progress prevented operation + ErrUnmerged = C.GIT_EUNMERGED + // Reference was not fast-forwardable + ErrNonFastForward = C.GIT_ENONFASTFORWARD + // Name/ref spec was not in a valid format + ErrInvalidSpec = C.GIT_EINVALIDSPEC + // Merge conflicts prevented operation + ErrMergeConflict = C.GIT_EMERGECONFLICT + // Lock file prevented operation + ErrLocked = C.GIT_ELOCKED + // Reference value does not match expected + ErrModified = C.GIT_EMODIFIED + // Internal only + ErrPassthrough = C.GIT_PASSTHROUGH + // Signals end of iteration with iterator + ErrIterOver = C.GIT_ITEROVER ) func init() {