aboutsummaryrefslogtreecommitdiffstats
path: root/send-pack.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-02-18 15:30:32 -0800
committerJunio C Hamano <gitster@pobox.com>2025-02-18 15:30:32 -0800
commit345aaf3976a6abc491026c8a465b5e8ccbc8da5a (patch)
treeed05fb25aad1b568206963db3bbf10ee15affd3a /send-pack.h
parente565f3755342caf1d21e22359eaf09ec11d8c0ae (diff)
parentb81f8c8dd3ec81a8d622e2d3d6b2af426ca53f05 (diff)
downloadgit-345aaf3976a6abc491026c8a465b5e8ccbc8da5a.tar.gz
Merge branch 'ps/send-pack-unhide-error-in-atomic-push'
"git push --atomic --porcelain" used to ignore failures from the other side, losing the error status from the child process, which has been corrected. * ps/send-pack-unhide-error-in-atomic-push: send-pack: gracefully close the connection for atomic push t5543: atomic push reports exit code failure send-pack: new return code "ERROR_SEND_PACK_BAD_REF_STATUS" t5548: add porcelain push test cases for dry-run mode t5548: add new porcelain test cases t5548: refactor test cases by resetting upstream t5548: refactor to reuse setup_upstream() function t5504: modernize test by moving heredocs into test bodies
Diffstat (limited to 'send-pack.h')
-rw-r--r--send-pack.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/send-pack.h b/send-pack.h
index d256715681..c5ded2d200 100644
--- a/send-pack.h
+++ b/send-pack.h
@@ -13,6 +13,9 @@ struct repository;
#define SEND_PACK_PUSH_CERT_IF_ASKED 1
#define SEND_PACK_PUSH_CERT_ALWAYS 2
+/* At least one reference has been rejected by the remote side. */
+#define ERROR_SEND_PACK_BAD_REF_STATUS 1
+
struct send_pack_args {
const char *url;
unsigned verbose:1,
@@ -36,6 +39,16 @@ struct option;
int option_parse_push_signed(const struct option *opt,
const char *arg, int unset);
+/*
+ * Compute a packfile and write it to a file descriptor. The `fd` array needs
+ * to contain two file descriptors: `fd[0]` is the file descriptor used as
+ * input for the packet reader, whereas `fd[1]` is the file descriptor the
+ * packfile will be written to.
+ *
+ * Returns 0 on success, non-zero otherwise. Negative return values indicate a
+ * generic error, whereas positive return values indicate specific error
+ * conditions as documented with the `ERROR_SEND_PACK_*` constants.
+ */
int send_pack(struct repository *r, struct send_pack_args *args,
int fd[], struct child_process *conn,
struct ref *remote_refs, struct oid_array *extra_have);