Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
867f7c9b
Commit
867f7c9b
authored
Oct 08, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename new fn to git_repository_reinit_filesystem
parent
92dac975
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
11 deletions
+12
-11
include/git2/sys/repository.h
+2
-2
src/repository.c
+4
-4
tests-clar/clar_libgit2.c
+1
-1
tests-clar/diff/patch.c
+2
-2
tests-clar/submodule/submodule_helpers.c
+3
-2
No files found.
include/git2/sys/repository.h
View file @
867f7c9b
...
...
@@ -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_re
se
t_filesystem
(
GIT_EXTERN
(
int
)
git_repository_re
ini
t_filesystem
(
git_repository
*
repo
,
int
recurse_submodules
);
...
...
src/repository.c
View file @
867f7c9b
...
...
@@ -1097,20 +1097,20 @@ cleanup:
return
error
;
}
static
int
repo_re
se
t_submodule_fs
(
git_submodule
*
sm
,
const
char
*
n
,
void
*
p
)
static
int
repo_re
ini
t_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_re
se
t_filesystem
(
smrepo
,
true
)
<
0
)
git_repository_re
ini
t_filesystem
(
smrepo
,
true
)
<
0
)
giterr_clear
();
git_repository_free
(
smrepo
);
return
0
;
}
int
git_repository_re
se
t_filesystem
(
git_repository
*
repo
,
int
recurse
)
int
git_repository_re
ini
t_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_re
se
t_submodule_fs
,
NULL
);
(
void
)
git_submodule_foreach
(
repo
,
repo_re
ini
t_submodule_fs
,
NULL
);
return
error
;
}
...
...
tests-clar/clar_libgit2.c
View file @
867f7c9b
...
...
@@ -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_re
se
t_filesystem
(
_cl_repo
,
0
));
cl_git_pass
(
git_repository_re
ini
t_filesystem
(
_cl_repo
,
0
));
return
_cl_repo
;
}
...
...
tests-clar/diff/patch.c
View file @
867f7c9b
...
...
@@ -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_re
se
t_filesystem
(
g_repo
,
false
);
git_repository_re
ini
t_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_re
se
t_filesystem
(
g_repo
,
false
);
git_repository_re
ini
t_filesystem
(
g_repo
,
false
);
cl_git_pass
(
git_futils_readbuffer
(
&
content
,
"renames/songof7cities.txt"
));
...
...
tests-clar/submodule/submodule_helpers.c
View file @
867f7c9b
...
...
@@ -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_re
se
t_filesystem
(
repo
,
1
));
cl_git_pass
(
git_repository_re
ini
t_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_re
se
t_filesystem
(
repo
,
1
));
cl_git_pass
(
git_repository_re
ini
t_filesystem
(
repo
,
1
));
return
repo
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment