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
945c92a5
Commit
945c92a5
authored
Mar 31, 2014
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add faster git_submodule__is_submodule check
parent
fad04120
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
src/submodule.c
+15
-0
src/submodule.h
+3
-0
No files found.
src/submodule.c
View file @
945c92a5
...
...
@@ -135,6 +135,21 @@ static int submodule_lookup(
* PUBLIC APIS
*/
bool
git_submodule__is_submodule
(
git_repository
*
repo
,
const
char
*
name
)
{
git_strmap
*
map
;
if
(
load_submodule_config
(
repo
,
false
)
<
0
)
{
giterr_clear
();
return
false
;
}
if
(
!
(
map
=
repo
->
submodules
))
return
false
;
return
git_strmap_valid_index
(
map
,
git_strmap_lookup_index
(
map
,
name
));
}
int
git_submodule_lookup
(
git_submodule
**
out
,
/* NULL if user only wants to test existence */
git_repository
*
repo
,
...
...
src/submodule.h
View file @
945c92a5
...
...
@@ -119,6 +119,9 @@ enum {
#define GIT_SUBMODULE_STATUS__CLEAR_INTERNAL(S) \
((S) & ~(0xFFFFFFFFu << 20))
/* Internal submodule check does not attempt to refresh cached data */
bool
git_submodule__is_submodule
(
git_repository
*
repo
,
const
char
*
name
);
/* Internal status fn returns status and optionally the various OIDs */
extern
int
git_submodule__status
(
unsigned
int
*
out_status
,
...
...
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