mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user