mirror of
https://github.com/git/git.git
synced 2024-05-20 16:56:10 +02:00
transport.c: remove implicit dependency on the_index
note, there's still another hidden dependency related to this: even though we pass a repo to transport_push() we still use is_bare_repository() which pretty much assumes the_repository (and some other global state). Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
878d832938
commit
6c6d5d0776
|
@ -355,7 +355,8 @@ static int push_with_options(struct transport *transport, struct refspec *rs,
|
||||||
|
|
||||||
if (verbosity > 0)
|
if (verbosity > 0)
|
||||||
fprintf(stderr, _("Pushing to %s\n"), transport->url);
|
fprintf(stderr, _("Pushing to %s\n"), transport->url);
|
||||||
err = transport_push(transport, rs, flags, &reject_reasons);
|
err = transport_push(the_repository, transport,
|
||||||
|
rs, flags, &reject_reasons);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
fprintf(stderr, "%s", push_get_color(PUSH_COLOR_ERROR));
|
fprintf(stderr, "%s", push_get_color(PUSH_COLOR_ERROR));
|
||||||
error(_("failed to push some refs to '%s'"), transport->url);
|
error(_("failed to push some refs to '%s'"), transport->url);
|
||||||
|
|
|
@ -1105,7 +1105,8 @@ static int run_pre_push_hook(struct transport *transport,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int transport_push(struct transport *transport,
|
int transport_push(struct repository *r,
|
||||||
|
struct transport *transport,
|
||||||
struct refspec *rs, int flags,
|
struct refspec *rs, int flags,
|
||||||
unsigned int *reject_reasons)
|
unsigned int *reject_reasons)
|
||||||
{
|
{
|
||||||
|
@ -1172,7 +1173,7 @@ int transport_push(struct transport *transport,
|
||||||
oid_array_append(&commits,
|
oid_array_append(&commits,
|
||||||
&ref->new_oid);
|
&ref->new_oid);
|
||||||
|
|
||||||
if (!push_unpushed_submodules(the_repository,
|
if (!push_unpushed_submodules(r,
|
||||||
&commits,
|
&commits,
|
||||||
transport->remote,
|
transport->remote,
|
||||||
rs,
|
rs,
|
||||||
|
@ -1197,7 +1198,7 @@ int transport_push(struct transport *transport,
|
||||||
oid_array_append(&commits,
|
oid_array_append(&commits,
|
||||||
&ref->new_oid);
|
&ref->new_oid);
|
||||||
|
|
||||||
if (find_unpushed_submodules(the_repository,
|
if (find_unpushed_submodules(r,
|
||||||
&commits,
|
&commits,
|
||||||
transport->remote->name,
|
transport->remote->name,
|
||||||
&needs_pushing)) {
|
&needs_pushing)) {
|
||||||
|
|
|
@ -223,7 +223,8 @@ void transport_set_verbosity(struct transport *transport, int verbosity,
|
||||||
#define REJECT_FETCH_FIRST 0x08
|
#define REJECT_FETCH_FIRST 0x08
|
||||||
#define REJECT_NEEDS_FORCE 0x10
|
#define REJECT_NEEDS_FORCE 0x10
|
||||||
|
|
||||||
int transport_push(struct transport *connection,
|
int transport_push(struct repository *repo,
|
||||||
|
struct transport *connection,
|
||||||
struct refspec *rs, int flags,
|
struct refspec *rs, int flags,
|
||||||
unsigned int * reject_reasons);
|
unsigned int * reject_reasons);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue