aboutsummaryrefslogtreecommitdiff
path: root/reachability/walk.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-06 10:38:46 +0800
committerGravatar Runxi Yu2026-03-06 10:38:46 +0800
commit7987e9350b590a4a9038ad18fe2ff049c0037cb8 (patch)
treedafe51aa15701676d52fc07b4b6163207e94e6bd /reachability/walk.go
parentreachability: Use commit-graph (diff)
signatureNo signature
reachability, internal/testgit: Fix lints v0.1.56
Diffstat (limited to 'reachability/walk.go')
-rw-r--r--reachability/walk.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/reachability/walk.go b/reachability/walk.go
index e96a8b44..4611e46e 100644
--- a/reachability/walk.go
+++ b/reachability/walk.go
@@ -111,20 +111,20 @@ func (walk *Walk) expand(item walkItem) ([]walkItem, error) {
}
func (walk *Walk) expandCommits(item walkItem) ([]walkItem, error) {
- if walk.reachability.graph != nil {
+ if walk.reachability.graph != nil { //nolint:nestif
next, graphUsed, err := walk.expandCommitsFromGraph(item.id)
if err != nil {
return nil, err
}
- if graphUsed {
- if walk.strict {
- err := walk.validateCommitObject(item.id)
- if err != nil {
- return nil, err
- }
+ if graphUsed && walk.strict {
+ err = walk.validateCommitObject(item.id)
+ if err != nil {
+ return nil, err
}
+ }
+ if graphUsed {
return next, nil
}
}