@@ -94,40 +94,53 @@ GIT_EXTERN(int) git_repository_discover(
9494
9595/**
9696 * Option flags for `git_repository_open_ext`.
97- *
98- * * GIT_REPOSITORY_OPEN_NO_SEARCH - Only open the repository if it can be
99- * immediately found in the start_path. Do not walk up from the
100- * start_path looking at parent directories.
101- * * GIT_REPOSITORY_OPEN_CROSS_FS - Unless this flag is set, open will not
102- * continue searching across filesystem boundaries (i.e. when `st_dev`
103- * changes from the `stat` system call). (E.g. Searching in a user's home
104- * directory "/home/user/source/" will not return "/.git/" as the found
105- * repo if "/" is a different filesystem than "/home".)
106- * * GIT_REPOSITORY_OPEN_BARE - Open repository as a bare repo regardless
107- * of core.bare config, and defer loading config file for faster setup.
108- * Unlike `git_repository_open_bare`, this can follow gitlinks.
109- * * GIT_REPOSITORY_OPEN_NO_DOTGIT - Do not check for a repository by
110- * appending /.git to the start_path; only open the repository if
111- * start_path itself points to the git directory.
112- * * GIT_REPOSITORY_OPEN_FROM_ENV - Find and open a git repository,
113- * respecting the environment variables used by the git command-line
114- * tools. If set, `git_repository_open_ext` will ignore the other
115- * flags and the `ceiling_dirs` argument, and will allow a NULL `path`
116- * to use `GIT_DIR` or search from the current directory. The search
117- * for a repository will respect $GIT_CEILING_DIRECTORIES and
118- * $GIT_DISCOVERY_ACROSS_FILESYSTEM. The opened repository will
119- * respect $GIT_INDEX_FILE, $GIT_NAMESPACE, $GIT_OBJECT_DIRECTORY, and
120- * $GIT_ALTERNATE_OBJECT_DIRECTORIES. In the future, this flag will
121- * also cause `git_repository_open_ext` to respect $GIT_WORK_TREE and
122- * $GIT_COMMON_DIR; currently, `git_repository_open_ext` with this
123- * flag will error out if either $GIT_WORK_TREE or $GIT_COMMON_DIR is
124- * set.
12597 */
12698typedef enum {
99+ /**
100+ * Only open the repository if it can be immediately found in the
101+ * start_path. Do not walk up from the start_path looking at parent
102+ * directories.
103+ */
127104 GIT_REPOSITORY_OPEN_NO_SEARCH = (1 << 0 ),
105+
106+ /**
107+ * Unless this flag is set, open will not continue searching across
108+ * filesystem boundaries (i.e. when `st_dev` changes from the `stat`
109+ * system call). For example, searching in a user's home directory at
110+ * "/home/user/source/" will not return "/.git/" as the found repo if
111+ * "/" is a different filesystem than "/home".
112+ */
128113 GIT_REPOSITORY_OPEN_CROSS_FS = (1 << 1 ),
114+
115+ /**
116+ * Open repository as a bare repo regardless of core.bare config, and
117+ * defer loading config file for faster setup.
118+ * Unlike `git_repository_open_bare`, this can follow gitlinks.
119+ */
129120 GIT_REPOSITORY_OPEN_BARE = (1 << 2 ),
121+
122+ /**
123+ * Do not check for a repository by appending /.git to the start_path;
124+ * only open the repository if start_path itself points to the git
125+ * directory.
126+ */
130127 GIT_REPOSITORY_OPEN_NO_DOTGIT = (1 << 3 ),
128+
129+ /**
130+ * Find and open a git repository, respecting the environment variables
131+ * used by the git command-line tools.
132+ * If set, `git_repository_open_ext` will ignore the other flags and
133+ * the `ceiling_dirs` argument, and will allow a NULL `path` to use
134+ * `GIT_DIR` or search from the current directory.
135+ * The search for a repository will respect $GIT_CEILING_DIRECTORIES and
136+ * $GIT_DISCOVERY_ACROSS_FILESYSTEM. The opened repository will
137+ * respect $GIT_INDEX_FILE, $GIT_NAMESPACE, $GIT_OBJECT_DIRECTORY, and
138+ * $GIT_ALTERNATE_OBJECT_DIRECTORIES.
139+ * In the future, this flag will also cause `git_repository_open_ext`
140+ * to respect $GIT_WORK_TREE and $GIT_COMMON_DIR; currently,
141+ * `git_repository_open_ext` with this flag will error out if either
142+ * $GIT_WORK_TREE or $GIT_COMMON_DIR is set.
143+ */
131144 GIT_REPOSITORY_OPEN_FROM_ENV = (1 << 4 ),
132145} git_repository_open_flag_t ;
133146
0 commit comments