blob: afca11e385b39cfcc4cd6e94ba369cb4c25d09cc (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package reachability
import (
"lindenii.org/go/furgit/errors"
objectid "lindenii.org/go/furgit/object/id"
objecttype "lindenii.org/go/furgit/object/type"
)
func (walk *Walk) validateCommitObject(id objectid.ObjectID) error {
ty, _, err := walk.reachability.fetcher.Header(id)
if err != nil {
return err
}
if ty != objecttype.TypeCommit {
return &errors.ObjectTypeError{OID: id, Got: ty, Want: objecttype.TypeCommit}
}
_, err = walk.reachability.fetcher.ExactCommit(id)
return err
}
|