aboutsummaryrefslogtreecommitdiffstats
path: root/scalar.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 /scalar.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 'scalar.c')
-rw-r--r--scalar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/scalar.c b/scalar.c
index da42b4be0c..d359f08bb8 100644
--- a/scalar.c
+++ b/scalar.c
@@ -241,7 +241,7 @@ static int add_or_remove_enlistment(int add)
static int start_fsmonitor_daemon(void)
{
- assert(have_fsmonitor_support());
+ ASSERT(have_fsmonitor_support());
if (fsmonitor_ipc__get_state() != IPC_STATE__LISTENING)
return run_git("fsmonitor--daemon", "start", NULL);
@@ -251,7 +251,7 @@ static int start_fsmonitor_daemon(void)
static int stop_fsmonitor_daemon(void)
{
- assert(have_fsmonitor_support());
+ ASSERT(have_fsmonitor_support());
if (fsmonitor_ipc__get_state() == IPC_STATE__LISTENING)
return run_git("fsmonitor--daemon", "stop", NULL);