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

Re: [Outreachy PATCH] merge: stop using the_repository

From
Usman Akinyemi <usmanakinyemi202@gmail.com>
Date
Oct 15, 2026, 16:59 UTC
Message-ID
<CAPSxiM_2Dd86rBKPj7jaT8Wmazo3PFZajJaaL2bVhB1GFsfnbg@mail.gmail.com>
In-Reply-To
<20261015142532.48175-1-okhuomonajayi54@gmail.com>
Show 12 quoted lines
>
> try_merge_command() and checkout_fast_forward() already receive a
> repository, so use it instead of relying on global variables.
>
> Add a repository parameter to merge_argument() and pass it
> from try_merge_command(). Use the repository in
> checkout_fast_forward() when parsing trees.
>
> Remove the now-unnecessary USE_THE_REPOSITORY_VARIABLE
> definition.
>
> Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
Good catch.
> ---
>  merge.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
Show 22 quoted lines
> +               strvec_push(&cmd.args, merge_argument(r, j->item));
>         strvec_push(&cmd.args, "--");
>         strvec_push(&cmd.args, head_arg);
>         for (j = remotes; j; j = j->next)
> -               strvec_push(&cmd.args, merge_argument(j->item));
> +               strvec_push(&cmd.args, merge_argument(r, j->item));
>
>         cmd.git_cmd = 1;
>         ret = run_command(&cmd);
> @@ -68,18 +66,18 @@ int checkout_fast_forward(struct repository *r,
>         memset(&trees, 0, sizeof(trees));
>         memset(&t, 0, sizeof(t));
>         }
>         for (i = 0; i < nr_trees; i++) {
> -               if (repo_parse_tree(the_repository, trees[i]) < 0) {
> +               if (repo_parse_tree(r, trees[i]) < 0) {
>                         rollback_lock_file(&lock_file);
>                         return -1;
>                 }
> --
> 2.54.0
>
looks good to me.
Previous: Okhuomon AjayiNext: Okhuomon Ajayi
Message 2 of 7 in “merge: stop using the_repository”
  1. merge: stop using the_repositoryOkhuomon Ajayi, Oct 15, 2026
  2. Usman AkinyemiOct 15, 2026
  3. Okhuomon AjayiOct 15, 2026
  4. Junio C HamanoNov 7, 2026
  5. Patrick SteinhardtNov 9, 2026
  6. Junio C HamanoOct 15, 2026
  7. Okhuomon AjayiOct 15, 2026

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.