Re: [PATCH] receive-pack: purge temporary data if no command is ready to run
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 24, 2022, 23:32 UTC
- Message-ID
- <xmqqk0eo1zhu.fsf@gitster.g>
- In-Reply-To
- <pull.1124.git.1642987616372.gitgitgadget@gmail.com>
Show 5 quoted lines
> + /* > + * If there is no command ready to run, should return directly to destroy > + * temporary data in the quarantine area. > + */ > + for (cmd = commands; cmd && cmd->error_string; cmd = cmd->next);
Write the empty body of the loop like this:
for (...) ; /* nothing */
to make it stand out.
> + if (!cmd) > + return; > +
Show 19 quoted lines
> -mk_empty () {
> +mk_empty() {
> repo_name="$1"
> rm -fr "$repo_name" &&
> - mkdir "$repo_name" &&
> - (
> - cd "$repo_name" &&
> - git init &&
> - git config receive.denyCurrentBranch warn &&
> - mv .git/hooks .git/hooks-disabled
> - )
> + mkdir "$repo_name" &&
> + (
> + cd "$repo_name" &&
> + git init &&
> + git config receive.denyCurrentBranch warn &&
> + mv .git/hooks .git/hooks-disabled
> + )
> }Documentation/CodingGuidelines. As far as I can tell, the above does not change anything the function does, and the only change in the patch is to violate the style guide badly. Why?