Skip to content

Commit 639cd8d

Browse files
bk2204gitster
authored andcommitted
reflog: rename unreachable
In C23, "unreachable" is a macro that invokes undefined behavior if it is invoked. To make sure that our code compiles on a variety of C versions, rename unreachable to "is_unreachable". Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e8b3bcf commit 639cd8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

reflog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static void mark_reachable(struct expire_reflog_policy_cb *cb)
210210
cb->mark_list = leftover;
211211
}
212212

213-
static int unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit, struct object_id *oid)
213+
static int is_unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit, struct object_id *oid)
214214
{
215215
/*
216216
* We may or may not have the commit yet - if not, look it
@@ -265,7 +265,7 @@ int should_expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
265265
return 1;
266266
case UE_NORMAL:
267267
case UE_HEAD:
268-
if (unreachable(cb, old_commit, ooid) || unreachable(cb, new_commit, noid))
268+
if (is_unreachable(cb, old_commit, ooid) || is_unreachable(cb, new_commit, noid))
269269
return 1;
270270
break;
271271
}

0 commit comments

Comments
 (0)