diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-06-03 22:11:11 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-06-03 22:11:12 +0200 |
commit | eb6392fb4f10ea627cf5f62740cf399e21378c9f (patch) | |
tree | ba8223e1cc72416f4e8e6adf6c36aa49b0399fdb /remote.c | |
parent | Merge branch 'ps/fix-reinit-includeif-onbranch' (diff) | |
parent | push: don't fetch commit object when checking existence (diff) | |
download | git-eb6392fb4f10ea627cf5f62740cf399e21378c9f.tar.xz git-eb6392fb4f10ea627cf5f62740cf399e21378c9f.zip |
Merge branch 'th/push-local-ff-check-without-lazy-fetch'
When "git push" notices that the commit at the tip of the ref on
the other side it is about to overwrite does not exist locally, it
used to first try fetching it if the local repository is a partial
clone. The command has been taught not to do so and immediately
fail instead.
* th/push-local-ff-check-without-lazy-fetch:
push: don't fetch commit object when checking existence
Diffstat (limited to 'remote.c')
-rw-r--r-- | remote.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1778,7 +1778,7 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, if (!reject_reason && !ref->deletion && !is_null_oid(&ref->old_oid)) { if (starts_with(ref->name, "refs/tags/")) reject_reason = REF_STATUS_REJECT_ALREADY_EXISTS; - else if (!repo_has_object_file(the_repository, &ref->old_oid)) + else if (!repo_has_object_file_with_flags(the_repository, &ref->old_oid, OBJECT_INFO_SKIP_FETCH_OBJECT)) reject_reason = REF_STATUS_REJECT_FETCH_FIRST; else if (!lookup_commit_reference_gently(the_repository, &ref->old_oid, 1) || !lookup_commit_reference_gently(the_repository, &ref->new_oid, 1)) |