Blob


1 /*
2 * Copyright (c) 2021 Stefan Sperling <stsp@openbsd.org>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
17 /*
18 * Write pack file data into the provided open packfile handle, for all
19 * objects reachable via the commits listed in 'ours'.
20 * Exclude any objects for commits listed in 'theirs' if 'theirs' is not NULL.
21 * Return the SHA1 digest of the resulting pack file in pack_sha1 which must
22 * be pre-allocated by the caller with at least SHA1_DIGEST_LENGTH bytes.
23 */
24 const struct got_error *got_pack_create(uint8_t *pack_sha1, FILE *packfile,
25 struct got_object_id **theirs, int ntheirs,
26 struct got_object_id **ours, int nours,
27 struct got_repository *repo, int loose_obj_only, int allow_empty,
28 got_pack_progress_cb progress_cb, void *progress_arg,
29 got_cancel_cb cancel_cb, void *cancel_arg);