File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -698,10 +698,15 @@ func convertToMinimalRelease(release *github.RepositoryRelease) MinimalRelease {
698698}
699699
700700func convertToMinimalTag (tag * github.RepositoryTag ) MinimalTag {
701- return MinimalTag {
701+ m := MinimalTag {
702702 Name : tag .GetName (),
703- SHA : tag .GetCommit ().GetSHA (),
704703 }
704+
705+ if commit := tag .GetCommit (); commit != nil {
706+ m .SHA = commit .GetSHA ()
707+ }
708+
709+ return m
705710}
706711
707712func convertToMinimalReviewThreadsResponse (query reviewThreadsQuery ) MinimalReviewThreadsResponse {
Original file line number Diff line number Diff line change @@ -28,12 +28,14 @@ func WithMaxDepth(d int) OptimizeListOption {
2828 }
2929}
3030
31- // WithPreservedFields sets keys that are exempt from all destructive strategies except whitespace normalization.
32- // Keys are matched against post-flatten map keys, so for nested fields like "user.html_url", the dotted key must be
33- // added explicitly. Empty collections are still dropped. Wins over collectionExtractors .
31+ // WithPreservedFields adds keys that are exempt from all destructive strategies except whitespace normalization.
32+ // Keys are matched against post-flatten map keys, so for nested fields like "user.html_url", the dotted key must
33+ // be added explicitly.
3434func WithPreservedFields (fields ... string ) OptimizeListOption {
3535 return func (c * OptimizeListConfig ) {
36- c .preservedFields = make (map [string ]bool , len (fields ))
36+ if c .preservedFields == nil {
37+ c .preservedFields = make (map [string ]bool , len (fields ))
38+ }
3739 for _ , f := range fields {
3840 c .preservedFields [f ] = true
3941 }
You can’t perform that action at this time.
0 commit comments