]> git.99rst.org Git - git.git/commit
refspec: stop depending on `the_repository`
authorPatrick Steinhardt <redacted>
Thu, 16 Jul 2026 12:38:04 +0000 (14:38 +0200)
committerJunio C Hamano <redacted>
Thu, 16 Jul 2026 20:58:25 +0000 (13:58 -0700)
commit01f4b61d0302af16b30b2b5141a53e3a88f9f98a
tree76eee2803241d7844f2c7d6cbb0e5702b3cecb6c
parentbb71c3f19e6a693fc1d32e4448be8520132d946e
refspec: stop depending on `the_repository`

The only remaining user of `the_hash_algo` in "refspec.c" is
`refspec_append()`, which needs to know the hash algorithm so that it
can parse the appended refspec item. In contrast to the functions
adapted in the preceding commit, this function always operates on a
`struct refspec`. As that structure is expected to only ever contain
refspecs that all use the same hash function it doesn't make sense
though to adapt each caller.

Instead, adapt the structure itself so that it gets initialized with a
hash function and use that hash function to parse new refspec items.
Adapt callers accordingly.

This removes the final dependency on the global repository variable in
"refspec.c", so we can drop `USE_THE_REPOSITORY_VARIABLE`.

Signed-off-by: Patrick Steinhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/fast-export.c
builtin/fetch.c
builtin/push.c
builtin/send-pack.c
builtin/submodule--helper.c
http-push.c
refspec.c
refspec.h
remote.c
transport-helper.c
git clone https://git.99rst.org/PROJECT