git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/1] remove unnecessary if statement

From
Usman Akinyemi <usmanakinyemi202@gmail.com>
Date
Apr 6, 2025, 12:14 UTC
Message-ID
<20250406121513.154084-1-usmanakinyemi202@gmail.com>
In-Reply-To
<20250329120327.105925-1-usmanakinyemi202@gmail.com>

In an earlier patch[1] (1a764cdbdc (Merge branch 'ua/some-builtins-wo-the-repository', 2025-03-26)) which has been merged to the master, we checked `repo` is not NULL before making call to `repo_config()`. Later, in another patch series[2] which has been merged to master, `repo_config()` was taught to allow `repo` to be NULL.

So there is not need for checking if the `repo` is NULL before calling repo_config() in the earlier patch.

Also, Patrick suggested having the test inside the "t1517-outside-repo.sh"[3] instead of having it in the individual test files like[2] and I also think it is a good approach as we will have all such tests in one place. So, for this patch, I added the test inside the "t1517-outside-repo.sh". If this is accepted, I will move the test for previous builtin cmd which has already been merged to master to "t1517-outside-repo.sh" file.

[1] https://public-inbox.org/git/20250210181103.3609495-1-usmanakinyemi202@gmail.com/ [2] https://public-inbox.org/git/20250307233543.1721552-1-usmanakinyemi202@gmail.com/ [3] https://public-inbox.org/git/Z9vCDFRUG7IzU_AG@pks.im/

Changes since v1
================
- Make reference to the previous commit that this commit depends on
via "git log" 
Usman Akinyemi (1):
  builtin/update-server-info: remove unnecessary if statement
 builtin/update-server-info.c | 4 ++--
 t/t1517-outside-repo.sh      | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)
Range-diff versus v1:
1:  d6054cbc0b ! 1:  020b228eb1 builtin/update-server-info: remove unnecessary if statement
    @@ Metadata
      ## Commit message ##
         builtin/update-server-info: remove unnecessary if statement
     
    -    Since we already teach the `repo_config()` to allow `repo`
    -    to be NULL, no need to check if `repo` is NULL before calling
    -    `repo_config()`.
    +    Since we already teach the `repo_config()` in "1a764cdbdc
    +    (Merge branch 'ua/some-builtins-wo-the-repository', 2025-03-26)
    +    to allow `repo` to be NULL, no need to check if `repo` is NULL
    +    before calling `repo_config()`.
     
         Mentored-by: Christian Couder <chriscool@tuxfamily.org>
         Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
-- 
2.49.0
Previous: Patrick SteinhardtNext: Usman Akinyemi
Message 4 of 9 in “remove unnecessary if statement”
  1. 0/1 remove unnecessary if statementUsman Akinyemi, Mar 29, 2025
  2. 1/1 builtin/update-server-info: remove unnecessary if statementUsman Akinyemi, Mar 29, 2025
  3. Patrick SteinhardtMar 31, 2025
  4. 0/1 remove unnecessary if statementUsman Akinyemi, Apr 6, 2025
  5. 1/1 builtin/update-server-info: remove unnecessary if statementUsman Akinyemi, Apr 6, 2025
  6. Eric SunshineApr 7, 2025
  7. Junio C HamanoApr 7, 2025
  8. 0/1 remove unnecessary if statementUsman Akinyemi, Apr 7, 2025
  9. 1/1 builtin/update-server-info: remove unnecessary if statementUsman Akinyemi, Apr 7, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.