Commit b97bd7a
checkpatch: prevent unbound variable error
The blamed commit set the option to make the script fail if it tries to
access any unbound variables, to catch possible errors. However, the
script now fails when invoked directly, due to:
> ./checkpatch.sh: line 218: GITHUB_REF: unbound variable
While this is not a problem in practice, given that the Cilium's
Makefile always sets the GITHUB_REF variable (possibly empty), let's
guard the variable accesses, to be a bit more user-friendly.
Fixes: 5d11067 ("checkpatch: make script exit if command exits with error")
Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>1 parent 60ee83e commit b97bd7a
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
0 commit comments