Git fork

Merge branch 'js/unreachable-workaround-for-no-symlink-head'

Code clean-up.

* js/unreachable-workaround-for-no-symlink-head:
refs: forbid clang to complain about unreachable code

+7 -1
+7 -1
refs/files-backend.c
··· 3327 3327 * next update. If not, we try and create a regular symref. 3328 3328 */ 3329 3329 if (update->new_target && refs->prefer_symlink_refs) 3330 - if (!create_ref_symlink(lock, update->new_target)) 3330 + /* 3331 + * By using the `NOT_CONSTANT()` trick, we can avoid 3332 + * errors by `clang`'s `-Wunreachable` logic that would 3333 + * report that the `continue` statement is not reachable 3334 + * when `NO_SYMLINK_HEAD` is `#define`d. 3335 + */ 3336 + if (NOT_CONSTANT(!create_ref_symlink(lock, update->new_target))) 3331 3337 continue; 3332 3338 3333 3339 if (update->flags & REF_NEEDS_COMMIT) {