diff options
author | Russell Belfer <rb@github.com> | 2013-06-29 13:13:38 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-07-10 12:14:13 -0700 |
commit | 3fe046cfdba414f69b09e76da2a550be96eeab7e (patch) | |
tree | cc00cde8b45f49aa13d55caf80803c90c4f5b13b /include/git2 | |
parent | 302a04b09ca706eeda9b8cceb50694f37973e348 (diff) | |
download | libgit2-3fe046cfdba414f69b09e76da2a550be96eeab7e.tar.gz |
Add BARE option to git_repository_open_ext
This adds a BARE option to git_repository_open_ext which allows
a fast open path that still knows how to read gitlinks and to
search for the actual .git directory from a subdirectory.
`git_repository_open_bare` is still simpler and faster, but having
a gitlink aware fast open is very useful for submodules where we
want to quickly be able to peek at the HEAD and index data without
doing any other meaningful repo operations.
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/repository.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h index c81051969..807d834fe 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -94,10 +94,14 @@ GIT_EXTERN(int) git_repository_discover( * changes from the `stat` system call). (E.g. Searching in a user's home * directory "/home/user/source/" will not return "/.git/" as the found * repo if "/" is a different filesystem than "/home".) + * * GIT_REPOSITORY_OPEN_BARE - Open repository as a bare repo regardless + * of core.bare config, and defer loading config file for faster setup. + * Unlike `git_repository_open_bare`, this can follow gitlinks. */ typedef enum { GIT_REPOSITORY_OPEN_NO_SEARCH = (1 << 0), GIT_REPOSITORY_OPEN_CROSS_FS = (1 << 1), + GIT_REPOSITORY_OPEN_BARE = (1 << 2), } git_repository_open_flag_t; /** |