Skip to content

Commit

Permalink
fix: Return an error if no commit was found (#2012)
Browse files Browse the repository at this point in the history
Ref: SRX-YNEAHU
  • Loading branch information
sven-urbanski-freiheit-com authored Oct 4, 2024
1 parent c1d056b commit 0414e75
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions services/cd-service/pkg/argocd/reposerver/reposerver.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ func (r *reposerver) ResolveRevision(ctx context.Context, req *argorepo.ResolveR
}
return nil, err
}
if state == nil || state.Commit == nil || state.Commit.Id() == nil {
return nil, fmt.Errorf("state has no commit when requesting revision: %v", req.AmbiguousRevision)
}
resp := argorepo.ResolveRevisionResponse{
XXX_NoUnkeyedLiteral: struct{}{},
XXX_unrecognized: nil,
Expand Down

0 comments on commit 0414e75

Please sign in to comment.