Thread (1 message) 1 message, 1 author, 2020-01-07

Re: [PATCH v2 1/1] unpack-trees: exit check_updates() early if updates are not wanted

From: Junio C Hamano <hidden>
Date: 2020-01-07 16:38:08

"Elijah Newren via GitGitGadget" [off-list ref] writes:
From: Elijah Newren <redacted>

check_updates() has a lot of code that repeatedly checks whether
o->update or o->dry_run are set.  (Note that o->dry_run is a
near-synonym for !o->update, but not quite as per commit 2c9078d05bf2
("unpack-trees: add the dry_run flag to unpack_trees_options",
2011-05-25).)  In fact, this function almost turns into a no-op whenever
the condition
   !o->update || o->dry_run
is met.  Simplify the code by checking this condition at the beginning
of the function, and when it is true, do the few things that are
relevant and return early.
Thanks; will queue.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help