Blob


1 /*
2 * Copyright (c) 2018, 2019, 2020 Stefan Sperling <stsp@openbsd.org>
3 * Copyright (c) 2023 Josh Rickmar <jrick@zettaport.com>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
18 /*
19 * Create a new commit from changes in the work tree.
20 * Return the ID of the newly created commit.
21 * The worktree's base commit will be set to this new commit.
22 * Files unaffected by this commit operation will retain their
23 * current base commit.
24 * An author and a non-empty log message must be specified.
25 * The name of the committer is optional (may be NULL).
26 * If a path to be committed contains a symlink which points outside
27 * of the path space under version control, raise an error unless
28 * committing of such paths is being forced by the caller.
29 */
30 const struct got_error *got_worktree_cvg_commit(struct got_object_id **,
31 struct got_worktree *, struct got_pathlist_head *, const char *,
32 const char *, int, int, int, got_worktree_commit_msg_cb, void *,
33 got_worktree_status_cb, void *, const char *, const char *, const char *,
34 const char *, int, const struct got_remote_repo *, got_cancel_cb,
35 struct got_repository *);
37 /*
38 * Get the reference name for a temporary commit to be trivially rebased
39 * over a remote branch.
40 */
41 const struct got_error *got_worktree_cvg_get_commit_ref_name(char **,
42 struct got_worktree *);