Blame


1 86c3caaf 2018-03-09 stsp /*
2 86c3caaf 2018-03-09 stsp * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
3 86c3caaf 2018-03-09 stsp *
4 86c3caaf 2018-03-09 stsp * Permission to use, copy, modify, and distribute this software for any
5 86c3caaf 2018-03-09 stsp * purpose with or without fee is hereby granted, provided that the above
6 86c3caaf 2018-03-09 stsp * copyright notice and this permission notice appear in all copies.
7 86c3caaf 2018-03-09 stsp *
8 86c3caaf 2018-03-09 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 86c3caaf 2018-03-09 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 86c3caaf 2018-03-09 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 86c3caaf 2018-03-09 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 86c3caaf 2018-03-09 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 86c3caaf 2018-03-09 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 86c3caaf 2018-03-09 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 86c3caaf 2018-03-09 stsp */
16 86c3caaf 2018-03-09 stsp
17 86c3caaf 2018-03-09 stsp struct got_worktree {
18 86c3caaf 2018-03-09 stsp char *path_worktree_root;
19 86c3caaf 2018-03-09 stsp char *path_repo;
20 577ec78f 2018-03-11 stsp char *path_prefix;
21 6d9d28c3 2018-03-11 stsp
22 6d9d28c3 2018-03-11 stsp /*
23 6d9d28c3 2018-03-11 stsp * This file descriptor exclusively locks GOT_WORKTREE_FILE_INDEX.
24 6d9d28c3 2018-03-11 stsp * This ensures that only one process opens the work tree at a time.
25 6d9d28c3 2018-03-11 stsp */
26 6d9d28c3 2018-03-11 stsp int fd_fileindex;
27 86c3caaf 2018-03-09 stsp };
28 86c3caaf 2018-03-09 stsp
29 577ec78f 2018-03-11 stsp #define GOT_WORKTREE_GOT_DIR ".got"
30 577ec78f 2018-03-11 stsp #define GOT_WORKTREE_FILE_INDEX "fileindex"
31 577ec78f 2018-03-11 stsp #define GOT_WORKTREE_REPOSITORY "repository"
32 577ec78f 2018-03-11 stsp #define GOT_WORKTREE_PATH_PREFIX "path-prefix"
33 577ec78f 2018-03-11 stsp #define GOT_WORKTREE_FORMAT "format"
34 1451e70d 2018-03-10 stsp
35 1451e70d 2018-03-10 stsp #define GOT_WORKTREE_FORMAT_VERSION 1