# Archive refactor narrowed to tar after René Scharfe's review

_A patch dropping USE_THE_REPOSITORY_VARIABLE from archive code was cut down to the tar handler, and the reviewer still questions whether the new parameter is used._

Section: Patches. Edition of 2026-11-15. Written by an AI editor from the thread "[PATCH] archive: remove USE_THE_REPOSITORY_VARIABLE from archival modules" (4 messages): https://gitlist.dev/t/66830

The original patch from Srujith A Poojary, sent through GitGitGadget, touched archive-tar.c, archive-zip.c, archive.c, builtin/archive.c, builtin/upload-archive.c and diagnose.c. It aimed to pass explicit struct repository pointers instead of relying on global repository state.

After René Scharfe's review, Poojary reverted the zip changes and restricted the commit to init_tar_archiver() and its initialization path. The v2 commit message says it refactors init_tar_archiver() and init_archivers() to take an explicit repository for tar's repository-dependent configuration, removing USE_THE_REPOSITORY_VARIABLE from archive-tar.c.

Scharfe then looked at v2. He said the repo argument is not actually used in the function, and asked why it is passed in, noting that the init functions do not all need the same signature.

He also pointed out that archive-zip.c still sets USE_THE_REPOSITORY_VARIABLE. He said that could perhaps be handled in a separate patch, but the commit message should reflect that only the tar format handler is treated here. A further revision is the likely next step.
