aboutsummaryrefslogtreecommitdiffstats
path: root/merge-ort.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-08 11:43:12 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-08 11:43:12 -0700
commitb97b360c514acd0f5a148524a85bcdb583dbe914 (patch)
treedc16900efcc7576ec5211f9c340e18bd01dd9020 /merge-ort.c
parentThe third batch (diff)
parenttreewide: replace assert() with ASSERT() in special cases (diff)
downloadgit-b97b360c514acd0f5a148524a85bcdb583dbe914.tar.gz
git-b97b360c514acd0f5a148524a85bcdb583dbe914.zip
Merge branch 'en/assert-wo-side-effects'
Ensure what we write in assert() does not have side effects, and introduce ASSERT() macro to mark those that cannot be mechanically checked for lack of side effects. * en/assert-wo-side-effects: treewide: replace assert() with ASSERT() in special cases ci: add build checking for side-effects in assert() calls git-compat-util: introduce ASSERT() macro
Diffstat (limited to 'merge-ort.c')
-rw-r--r--merge-ort.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/merge-ort.c b/merge-ort.c
index 2b7d86aa4e..c41f466577 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -791,7 +791,7 @@ static void path_msg(struct merge_options *opt,
struct strbuf tmp = STRBUF_INIT;
/* Sanity checks */
- assert(omittable_hint ==
+ ASSERT(omittable_hint ==
(!starts_with(type_short_descriptions[type], "CONFLICT") &&
!starts_with(type_short_descriptions[type], "ERROR")) ||
type == CONFLICT_DIR_RENAME_SUGGESTED);
@@ -1642,7 +1642,7 @@ static int handle_deferred_entries(struct merge_options *opt,
ci = strmap_get(&opt->priv->paths, path);
VERIFY_CI(ci);
- assert(renames->deferred[side].trivial_merges_okay &&
+ ASSERT(renames->deferred[side].trivial_merges_okay &&
!strset_contains(&renames->deferred[side].target_dirs,
path));
resolve_trivial_directory_merge(ci, side);