diff options
| author | Russell Belfer <rb@github.com> | 2013-06-21 11:51:16 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-06-21 11:55:13 -0700 |
| commit | 9094ae5a3c12ee99743498cb8e895d18b932e4dd (patch) | |
| tree | d9018379bf5d6b784681f256ebd5186e0662688f /src/iterator.h | |
| parent | 00197c34d6385a2de3970c9f820714064c5bf27f (diff) | |
| download | libgit2-9094ae5a3c12ee99743498cb8e895d18b932e4dd.tar.gz | |
Add target directory to checkout
This adds the ability for checkout to write to a target directory
instead of having to use the working directory of the repository.
This makes it easier to do exports of repository data and the like.
This is similar to, but not quite the same as, the --prefix option
to `git checkout-index` (this will always be treated as a directory
name, not just as a simple text prefix).
As part of this, the workdir iterator was extended to take the
path to the working directory as a parameter and fallback on the
git_repository_workdir result only if it's not specified.
Fixes #1332
Diffstat (limited to 'src/iterator.h')
| -rw-r--r-- | src/iterator.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/iterator.h b/src/iterator.h index 493ff4b2a..ea88fa6a2 100644 --- a/src/iterator.h +++ b/src/iterator.h @@ -79,15 +79,26 @@ extern int git_iterator_for_index( const char *start, const char *end); +extern int git_iterator_for_workdir_ext( + git_iterator **out, + git_repository *repo, + const char *repo_workdir, + git_iterator_flag_t flags, + const char *start, + const char *end); + /* workdir iterators will match the ignore_case value from the index of the * repository, unless you override with a non-zero flag value */ -extern int git_iterator_for_workdir( +GIT_INLINE(int) git_iterator_for_workdir( git_iterator **out, git_repository *repo, git_iterator_flag_t flags, const char *start, - const char *end); + const char *end) +{ + return git_iterator_for_workdir_ext(out, repo, NULL, flags, start, end); +} /* for filesystem iterators, you have to explicitly pass in the ignore_case * behavior that you desire |
