]>
Commit | Line | Data |
---|---|---|
662880ca RB |
1 | /* |
2 | * Copyright (C) 2012 the libgit2 contributors | |
3 | * | |
4 | * This file is part of libgit2, distributed under the GNU GPL v2 with | |
5 | * a Linking Exception. For full terms see the included COPYING file. | |
6 | */ | |
7 | #ifndef INCLUDE_repo_template_h__ | |
8 | #define INCLUDE_repo_template_h__ | |
9 | ||
10 | #define GIT_OBJECTS_INFO_DIR GIT_OBJECTS_DIR "info/" | |
11 | #define GIT_OBJECTS_PACK_DIR GIT_OBJECTS_DIR "pack/" | |
12 | ||
13 | #define GIT_HOOKS_DIR "hooks/" | |
14 | #define GIT_HOOKS_DIR_MODE 0755 | |
15 | ||
16 | #define GIT_HOOKS_README_FILE GIT_HOOKS_DIR "README.sample" | |
17 | #define GIT_HOOKS_README_MODE 0755 | |
18 | #define GIT_HOOKS_README_CONTENT \ | |
19 | "#!/bin/sh\n"\ | |
20 | "#\n"\ | |
21 | "# Place appropriately named executable hook scripts into this directory\n"\ | |
22 | "# to intercept various actions that git takes. See `git help hooks` for\n"\ | |
23 | "# more information.\n" | |
24 | ||
25 | #define GIT_INFO_DIR "info/" | |
26 | #define GIT_INFO_DIR_MODE 0755 | |
27 | ||
28 | #define GIT_INFO_EXCLUDE_FILE GIT_INFO_DIR "exclude" | |
29 | #define GIT_INFO_EXCLUDE_MODE 0644 | |
30 | #define GIT_INFO_EXCLUDE_CONTENT \ | |
31 | "# File patterns to ignore; see `git help ignore` for more information.\n"\ | |
32 | "# Lines that start with '#' are comments.\n" | |
33 | ||
34 | #define GIT_DESC_FILE "description" | |
35 | #define GIT_DESC_MODE 0644 | |
36 | #define GIT_DESC_CONTENT \ | |
37 | "Unnamed repository; edit this file 'description' to name the repository.\n" | |
38 | ||
39 | typedef struct { | |
40 | const char *path; | |
41 | mode_t mode; | |
42 | const char *content; | |
43 | } repo_template_item; | |
44 | ||
45 | static repo_template_item repo_template[] = { | |
46 | { GIT_OBJECTS_INFO_DIR, GIT_OBJECT_DIR_MODE, NULL }, /* '/objects/info/' */ | |
47 | { GIT_OBJECTS_PACK_DIR, GIT_OBJECT_DIR_MODE, NULL }, /* '/objects/pack/' */ | |
48 | { GIT_REFS_HEADS_DIR, GIT_REFS_DIR_MODE, NULL }, /* '/refs/heads/' */ | |
49 | { GIT_REFS_TAGS_DIR, GIT_REFS_DIR_MODE, NULL }, /* '/refs/tags/' */ | |
50 | { GIT_HOOKS_DIR, GIT_HOOKS_DIR_MODE, NULL }, /* '/hooks/' */ | |
51 | { GIT_INFO_DIR, GIT_INFO_DIR_MODE, NULL }, /* '/info/' */ | |
52 | { GIT_DESC_FILE, GIT_DESC_MODE, GIT_DESC_CONTENT }, | |
53 | { GIT_HOOKS_README_FILE, GIT_HOOKS_README_MODE, GIT_HOOKS_README_CONTENT }, | |
54 | { GIT_INFO_EXCLUDE_FILE, GIT_INFO_EXCLUDE_MODE, GIT_INFO_EXCLUDE_CONTENT }, | |
55 | { NULL, 0, NULL } | |
56 | }; | |
57 | ||
58 | #endif |