From: Junio C Hamano Date: Tue, 07 Jan 2020 16:37:59 GMT Subject: Re: [PATCH v2 1/1] unpack-trees: exit check_updates() early if updates are not wanted Message-ID: In-Reply-To: "Elijah Newren via GitGitGadget" writes: > From: Elijah Newren > > 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.