File tree 5 files changed +17
-15
lines changed
5 files changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ require (
14
14
google.golang.org/grpc v1.56.3
15
15
gopkg.in/go-playground/webhooks.v3 v3.13.0
16
16
gopkg.in/yaml.v2 v2.3.0
17
- knative.dev/hack v0.0.0-20240814130635-06f7aff93954
17
+ knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d
18
18
)
19
19
20
20
require (
Original file line number Diff line number Diff line change @@ -241,5 +241,5 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh
241
241
honnef.co/go/tools v0.0.1-2019.2.3 /go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg =
242
242
honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k =
243
243
honnef.co/go/tools v0.0.1-2020.1.5 /go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k =
244
- knative.dev/hack v0.0.0-20240814130635-06f7aff93954 h1:dGMK5VoL75szvrYQTL9NqhPYHu1f5dGaXx1hJI8fAFM =
245
- knative.dev/hack v0.0.0-20240814130635-06f7aff93954 /go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY =
244
+ knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d h1:mgROhGJG3+g0SBkaG4Y2HxrIOLN3ZZcN4+IFZla+Zqs =
245
+ knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d /go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY =
Original file line number Diff line number Diff line change @@ -133,16 +133,18 @@ function restore-changes-if-its-copyright-year-only() {
133
133
local difflist
134
134
log " Cleaning up generated code"
135
135
difflist=" $( mktemp) "
136
- git diff --exit-code --name-only > " $difflist "
137
- # list git changes and skip those which differ only in the boilerplate year
138
- while read -r file; do
139
- # check if the file contains just the change in the boilerplate year
140
- if [ " $( LANG=C git diff --exit-code --shortstat -- " $file " ) " = ' 1 file changed, 1 insertion(+), 1 deletion(-)' ] && \
141
- [[ " $( git diff --exit-code -U1 -- " $file " | grep -Ec ' ^[+-]\s*[*#]?\s*Copyright 2[0-9]{3}' ) " -eq 2 ]]; then
142
- # restore changes to that file
143
- git checkout -- " $file "
144
- fi
145
- done < " $difflist "
136
+ if ! git diff --exit-code --name-only > /dev/null; then
137
+ # list git changes and skip those which differ only in the boilerplate year
138
+ git diff --name-only > " $difflist "
139
+ while read -r file; do
140
+ # check if the file contains just the change in the boilerplate year
141
+ if [ " $( LANG=C git diff --exit-code --shortstat -- " $file " ) " = ' 1 file changed, 1 insertion(+), 1 deletion(-)' ] && \
142
+ [[ " $( git diff --exit-code -U1 -- " $file " | grep -Ec ' ^[+-]\s*[*#]?\s*Copyright 2[0-9]{3}' ) " -eq 2 ]]; then
143
+ # restore changes to that file
144
+ git checkout -- " $file "
145
+ fi
146
+ done < " $difflist "
147
+ fi
146
148
rm -f " $difflist "
147
149
}
148
150
Original file line number Diff line number Diff line change @@ -774,7 +774,7 @@ function go_update_deps() {
774
774
function __clean_goworksum_if_exists() {
775
775
if [ -f " $REPO_ROOT_DIR /go.work.sum" ]; then
776
776
log.step ' Cleaning the go.work.sum file'
777
- truncate --size 0 " $REPO_ROOT_DIR /go.work.sum"
777
+ truncate -s 0 " $REPO_ROOT_DIR /go.work.sum"
778
778
fi
779
779
}
780
780
Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ gopkg.in/go-playground/webhooks.v3/github
318
318
gopkg.in/yaml.v2
319
319
# honnef.co/go/tools v0.0.1-2020.1.5
320
320
## explicit; go 1.11
321
- # knative.dev/hack v0.0.0-20240814130635-06f7aff93954
321
+ # knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d
322
322
## explicit; go 1.21
323
323
knative.dev/hack
324
324
# go.opencensus.io => go.opencensus.io v0.20.2
You can’t perform that action at this time.
0 commit comments