Thread (24 messages) flat view 24 messages, 4 authors, 2021-11-10

Re: [PATCH v5 2/4] receive-pack: Clean dead code from update_worktree()

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-11-10 03:59:41

On Tue, Nov 09 2021, Anders Kaseorg wrote:
+	if (!worktree || !worktree->path)
+		BUG("worktree->path must be non-NULL");
Perhaps a metter of taste, but I think BUG() should really be used for
things that need a custom message over and beyond what assert() gives
us.

In this case using BUG() gives you a worse message, if you do:

    assert(worktree && worktree->path)

You'll get a sensible message from any modern compiler quotign the
variable etc, all of which says the same thing as that BUG() message,
just with less verbosity.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help