error.go 702 B

123456789101112131415161718192021222324
  1. // Copyright 2020 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package gitutil
  5. import (
  6. "github.com/gogs/git-module"
  7. )
  8. // IsErrRevisionNotExist returns true if the error is git.ErrRevisionNotExist.
  9. func IsErrRevisionNotExist(err error) bool {
  10. return err == git.ErrRevisionNotExist
  11. }
  12. // IsErrNoMergeBase returns true if the error is git.ErrNoMergeBase.
  13. func IsErrNoMergeBase(err error) bool {
  14. return err == git.ErrNoMergeBase
  15. }
  16. // IsErrSubmoduleNotExist returns true if the error is git.ErrSubmoduleNotExist.
  17. func IsErrSubmoduleNotExist(err error) bool {
  18. return err == git.ErrSubmoduleNotExist
  19. }