Blame


1 7b19e0f1 2017-11-05 stsp /*
2 3b339b2f 2018-02-12 stsp * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
3 7b19e0f1 2017-11-05 stsp *
4 7b19e0f1 2017-11-05 stsp * Permission to use, copy, modify, and distribute this software for any
5 7b19e0f1 2017-11-05 stsp * purpose with or without fee is hereby granted, provided that the above
6 7b19e0f1 2017-11-05 stsp * copyright notice and this permission notice appear in all copies.
7 7b19e0f1 2017-11-05 stsp *
8 7b19e0f1 2017-11-05 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 7b19e0f1 2017-11-05 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 7b19e0f1 2017-11-05 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 7b19e0f1 2017-11-05 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 7b19e0f1 2017-11-05 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 7b19e0f1 2017-11-05 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 7b19e0f1 2017-11-05 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 7b19e0f1 2017-11-05 stsp */
16 7b19e0f1 2017-11-05 stsp
17 3b339b2f 2018-02-12 stsp struct got_repository;
18 4027f31a 2017-11-04 stsp
19 0c60ce5a 2018-04-02 stsp /* Open and close repositories. */
20 4027f31a 2017-11-04 stsp const struct got_error *got_repo_open(struct got_repository**, const char *);
21 ad242220 2018-09-08 stsp const struct got_error *got_repo_close(struct got_repository*);
22 4027f31a 2017-11-04 stsp
23 0c60ce5a 2018-04-02 stsp /*
24 0c60ce5a 2018-04-02 stsp * Obtain paths to various directories within a repository.
25 0c60ce5a 2018-04-02 stsp * The caller must dispose of a path with free(3).
26 0c60ce5a 2018-04-02 stsp */
27 86c3caaf 2018-03-09 stsp char *got_repo_get_path(struct got_repository *);
28 11995603 2017-11-05 stsp char *got_repo_get_path_git_dir(struct got_repository *);
29 11995603 2017-11-05 stsp char *got_repo_get_path_objects(struct got_repository *);
30 a1fd68d8 2018-01-12 stsp char *got_repo_get_path_objects_pack(struct got_repository *);
31 11995603 2017-11-05 stsp char *got_repo_get_path_refs(struct got_repository *);
32 11995603 2017-11-05 stsp
33 11995603 2017-11-05 stsp struct got_reference;
34 11995603 2017-11-05 stsp
35 0c60ce5a 2018-04-02 stsp /*
36 0c60ce5a 2018-04-02 stsp * Obtain a reference, by name, from a repository.
37 0c60ce5a 2018-04-02 stsp * The caller must dispose of it with got_ref_close().
38 0c60ce5a 2018-04-02 stsp */
39 4027f31a 2017-11-04 stsp const struct got_error *got_repo_get_reference(struct got_reference **,
40 4027f31a 2017-11-04 stsp struct got_repository *, const char *);
41 04ca23f4 2018-07-16 stsp
42 04ca23f4 2018-07-16 stsp
43 04ca23f4 2018-07-16 stsp /* Indicate whether this is a bare repositiry (contains no git working tree). */
44 04ca23f4 2018-07-16 stsp int got_repo_is_bare(struct got_repository *);
45 04ca23f4 2018-07-16 stsp
46 04ca23f4 2018-07-16 stsp /* Attempt to map an arbitrary path to a path within the repository. */
47 04ca23f4 2018-07-16 stsp const struct got_error *got_repo_map_path(char **, struct got_repository *,
48 04ca23f4 2018-07-16 stsp const char *);