Rename new fn to git_repository_reinit_filesystem
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
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;
}