Commit 867f7c9b3329952dc0aebf9770019a7a01ff2691

Russell Belfer 2013-10-08T16:59:59

Rename new fn to git_repository_reinit_filesystem

diff --git a/include/git2/sys/repository.h b/include/git2/sys/repository.h
index e77b1dc..36f8b58 100644
--- a/include/git2/sys/repository.h
+++ b/include/git2/sys/repository.h
@@ -52,10 +52,10 @@ GIT_EXTERN(void) git_repository__cleanup(git_repository *repo);
  * properties to compensate for the current filesystem of the repo.
  *
  * @param repo A repository object
- * @param recurse_submodules Should submodules be reset recursively
+ * @param recurse_submodules Should submodules be updated recursively
  * @returrn 0 on success, < 0 on error
  */
-GIT_EXTERN(int) git_repository_reset_filesystem(
+GIT_EXTERN(int) git_repository_reinit_filesystem(
 	git_repository *repo,
 	int recurse_submodules);
 
diff --git a/src/repository.c b/src/repository.c
index 23cafe0..c5ce842 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -1097,20 +1097,20 @@ cleanup:
 	return error;
 }
 
-static int repo_reset_submodule_fs(git_submodule *sm, const char *n, void *p)
+static int repo_reinit_submodule_fs(git_submodule *sm, const char *n, void *p)
 {
 	git_repository *smrepo = NULL;
 	GIT_UNUSED(n); GIT_UNUSED(p);
 
 	if (git_submodule_open(&smrepo, sm) < 0 ||
-		git_repository_reset_filesystem(smrepo, true) < 0)
+		git_repository_reinit_filesystem(smrepo, true) < 0)
 		giterr_clear();
 	git_repository_free(smrepo);
 
 	return 0;
 }
 
-int git_repository_reset_filesystem(git_repository *repo, int recurse)
+int git_repository_reinit_filesystem(git_repository *repo, int recurse)
 {
 	int error = 0;
 	git_buf path = GIT_BUF_INIT;
@@ -1127,7 +1127,7 @@ int git_repository_reset_filesystem(git_repository *repo, int recurse)
 	git_repository__cvar_cache_clear(repo);
 
 	if (!repo->is_bare && recurse)
-		(void)git_submodule_foreach(repo, repo_reset_submodule_fs, NULL);
+		(void)git_submodule_foreach(repo, repo_reinit_submodule_fs, NULL);
 
 	return error;
 }
diff --git a/tests-clar/clar_libgit2.c b/tests-clar/clar_libgit2.c
index 9f65953..50762cd 100644
--- a/tests-clar/clar_libgit2.c
+++ b/tests-clar/clar_libgit2.c
@@ -192,7 +192,7 @@ git_repository *cl_git_sandbox_init(const char *sandbox)
 	cl_git_pass(git_repository_open(&_cl_repo, sandbox));
 
 	/* Adjust configs after copying to new filesystem */
-	cl_git_pass(git_repository_reset_filesystem(_cl_repo, 0));
+	cl_git_pass(git_repository_reinit_filesystem(_cl_repo, 0));
 
 	return _cl_repo;
 }
diff --git a/tests-clar/diff/patch.c b/tests-clar/diff/patch.c
index 1dbfc9a..171abc8 100644
--- a/tests-clar/diff/patch.c
+++ b/tests-clar/diff/patch.c
@@ -240,7 +240,7 @@ void test_diff_patch__hunks_have_correct_line_numbers(void)
 	git_repository_set_config(g_repo, cfg);
 	git_config_free(cfg);
 
-	git_repository_reset_filesystem(g_repo, false);
+	git_repository_reinit_filesystem(g_repo, false);
 
 	cl_git_pass(
 		git_futils_readbuffer(&old_content, "renames/songof7cities.txt"));
@@ -524,7 +524,7 @@ void test_diff_patch__line_counts_with_eofnl(void)
 	git_repository_set_config(g_repo, cfg);
 	git_config_free(cfg);
 
-	git_repository_reset_filesystem(g_repo, false);
+	git_repository_reinit_filesystem(g_repo, false);
 
 	cl_git_pass(git_futils_readbuffer(&content, "renames/songof7cities.txt"));
 
diff --git a/tests-clar/submodule/submodule_helpers.c b/tests-clar/submodule/submodule_helpers.c
index cc3b7a2..d575067 100644
--- a/tests-clar/submodule/submodule_helpers.c
+++ b/tests-clar/submodule/submodule_helpers.c
@@ -4,6 +4,7 @@
 #include "util.h"
 #include "posix.h"
 #include "submodule_helpers.h"
+#include "git2/sys/repository.h"
 
 /* rewrite gitmodules -> .gitmodules
  * rewrite the empty or relative urls inside each module
@@ -102,7 +103,7 @@ git_repository *setup_fixture_submodules(void)
 
 	cl_set_cleanup(cleanup_fixture_submodules, "testrepo.git");
 
-	cl_git_pass(git_repository_reset_filesystem(repo, 1));
+	cl_git_pass(git_repository_reinit_filesystem(repo, 1));
 
 	return repo;
 }
@@ -120,7 +121,7 @@ git_repository *setup_fixture_submod2(void)
 
 	cl_set_cleanup(cleanup_fixture_submodules, "submod2_target");
 
-	cl_git_pass(git_repository_reset_filesystem(repo, 1));
+	cl_git_pass(git_repository_reinit_filesystem(repo, 1));
 
 	return repo;
 }