MCPcopy Create free account
hub / github.com/git/git / discover_git_directory

Function discover_git_directory

setup.h:91–97  ·  view source on GitHub ↗

* Find the commondir and gitdir of the repository that contains the current * working directory, without changing the working directory or other global * state. The result is appended to commondir and gitdir. If the discovered * gitdir does not correspond to a worktree, then 'commondir' and 'gitdir' will * both have the same result appended to the buffer. The return value is * either 0 upon

Source from the content-addressed store, hash-verified

89 * either 0 upon success and -1 if no repository was found.
90 */
91static inline int discover_git_directory(struct strbuf *commondir,
92 struct strbuf *gitdir)
93{
94 if (discover_git_directory_reason(commondir, gitdir) <= 0)
95 return -1;
96 return 0;
97}
98
99void set_git_work_tree(struct repository *repo, const char *tree);
100

Callers 1

read_early_configFunction · 0.85

Calls 1

Tested by

no test coverage detected