summaryrefslogtreecommitdiff
path: root/tests-clar/clar_libgit2.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-04-11 11:52:59 -0700
committerRussell Belfer <rb@github.com>2012-04-11 12:11:35 -0700
commit7784bcbbee972d1f00ea88655a5592fb44ca767d (patch)
tree75926bc03a5f7f072878af8eb3e0e37b7fa66d4f /tests-clar/clar_libgit2.h
parent1de77cd31432a1bdff060181c6d9ec25a412a0c2 (diff)
downloadlibgit2-7784bcbbee972d1f00ea88655a5592fb44ca767d.tar.gz
Refactor git_repository_open with new options
Add a new command `git_repository_open_ext` with extended options that control how searching for a repository will be done. The existing `git_repository_open` and `git_repository_discover` are reimplemented on top of it. We may want to change the default behavior of `git_repository_open` but this commit does not do that. Improve support for "gitdir" files where the work dir is separate from the repo and support for the "separate-git-dir" config. Also, add support for opening repos created with `git-new-workdir` script (although I have only confirmed that they can be opened, not that all functions work correctly). There are also a few minor changes that came up: - Fix `git_path_prettify` to allow in-place prettifying. - Fix `git_path_root` to support backslashes on Win32. This fix should help many repo open/discover scenarios - it is the one function called when opening before prettifying the path. - Tweak `git_config_get_string` to set the "out" pointer to NULL if the config value is not found. Allows some other cleanup. - Fix a couple places that should have been calling `git_repository_config__weakptr` and were not. - Fix `cl_git_sandbox_init` clar helper to support bare repos.
Diffstat (limited to 'tests-clar/clar_libgit2.h')
-rw-r--r--tests-clar/clar_libgit2.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests-clar/clar_libgit2.h b/tests-clar/clar_libgit2.h
index 5c034a385..bb2feee6a 100644
--- a/tests-clar/clar_libgit2.h
+++ b/tests-clar/clar_libgit2.h
@@ -57,6 +57,8 @@ GIT_INLINE(void) cl_assert_strequal_internal(
/* Write the contents of a buffer to disk */
void cl_git_mkfile(const char *filename, const char *content);
void cl_git_append2file(const char *filename, const char *new_content);
+void cl_git_rewritefile(const char *filename, const char *new_content);
+void cl_git_write2file(const char *filename, const char *new_content, int mode);
/* Git sandbox setup helpers */