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
cfc2ae68
Commit
cfc2ae68
authored
Jul 27, 2022
by
yuangli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eliminate build warnings
parent
83f71b12
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
10 deletions
+11
-10
src/libgit2/commit.c
+3
-4
src/libgit2/grafts.c
+3
-3
src/libgit2/libgit2.c
+2
-0
src/libgit2/repository.c
+3
-3
tests/libgit2/grafts/basic.c
+0
-0
tests/libgit2/grafts/parse.c
+0
-0
tests/libgit2/grafts/shallow.c
+0
-0
No files found.
src/libgit2/commit.c
View file @
cfc2ae68
...
@@ -501,8 +501,10 @@ int git_commit__parse_raw(void *commit, const char *data, size_t size)
...
@@ -501,8 +501,10 @@ int git_commit__parse_raw(void *commit, const char *data, size_t size)
int
git_commit__parse_ext
(
git_commit
*
commit
,
git_odb_object
*
odb_obj
,
unsigned
int
flags
)
int
git_commit__parse_ext
(
git_commit
*
commit
,
git_odb_object
*
odb_obj
,
unsigned
int
flags
)
{
{
git_repository
*
repo
=
git_object_owner
((
git_object
*
)
commit
);
git_commit_graft
*
graft
;
int
error
;
int
error
;
if
((
error
=
commit_parse
(
commit
,
git_odb_object_data
(
odb_obj
),
if
((
error
=
commit_parse
(
commit
,
git_odb_object_data
(
odb_obj
),
git_odb_object_size
(
odb_obj
),
flags
))
<
0
)
git_odb_object_size
(
odb_obj
),
flags
))
<
0
)
return
error
;
return
error
;
...
@@ -510,9 +512,6 @@ int git_commit__parse_ext(git_commit *commit, git_odb_object *odb_obj, unsigned
...
@@ -510,9 +512,6 @@ int git_commit__parse_ext(git_commit *commit, git_odb_object *odb_obj, unsigned
if
(
!
git_shallow__enabled
)
if
(
!
git_shallow__enabled
)
return
0
;
return
0
;
git_repository
*
repo
=
git_object_owner
((
git_object
*
)
commit
);
git_commit_graft
*
graft
;
/* Perform necessary grafts */
/* Perform necessary grafts */
if
(
git_grafts_get
(
&
graft
,
repo
->
grafts
,
git_odb_object_id
(
odb_obj
))
==
0
||
if
(
git_grafts_get
(
&
graft
,
repo
->
grafts
,
git_odb_object_id
(
odb_obj
))
==
0
||
git_grafts_get
(
&
graft
,
repo
->
shallow_grafts
,
git_odb_object_id
(
odb_obj
))
==
0
)
{
git_grafts_get
(
&
graft
,
repo
->
shallow_grafts
,
git_odb_object_id
(
odb_obj
))
==
0
)
{
...
...
src/libgit2/grafts.c
View file @
cfc2ae68
...
@@ -85,7 +85,7 @@ void git_grafts_clear(git_grafts *grafts)
...
@@ -85,7 +85,7 @@ void git_grafts_clear(git_grafts *grafts)
int
git_grafts_refresh
(
git_grafts
*
grafts
)
int
git_grafts_refresh
(
git_grafts
*
grafts
)
{
{
git_
buf
contents
=
GIT_BUF
_INIT
;
git_
str
contents
=
GIT_STR
_INIT
;
int
error
,
updated
=
0
;
int
error
,
updated
=
0
;
assert
(
grafts
);
assert
(
grafts
);
...
@@ -94,7 +94,7 @@ int git_grafts_refresh(git_grafts *grafts)
...
@@ -94,7 +94,7 @@ int git_grafts_refresh(git_grafts *grafts)
return
0
;
return
0
;
error
=
git_futils_readbuffer_updated
(
&
contents
,
grafts
->
path
,
error
=
git_futils_readbuffer_updated
(
&
contents
,
grafts
->
path
,
&
grafts
->
path_checksum
,
&
updated
);
(
grafts
->
path_checksum
).
id
,
&
updated
);
if
(
error
<
0
||
error
==
GIT_ENOTFOUND
||
!
updated
)
{
if
(
error
<
0
||
error
==
GIT_ENOTFOUND
||
!
updated
)
{
if
(
error
==
GIT_ENOTFOUND
)
{
if
(
error
==
GIT_ENOTFOUND
)
{
git_grafts_clear
(
grafts
);
git_grafts_clear
(
grafts
);
...
@@ -107,7 +107,7 @@ int git_grafts_refresh(git_grafts *grafts)
...
@@ -107,7 +107,7 @@ int git_grafts_refresh(git_grafts *grafts)
goto
cleanup
;
goto
cleanup
;
cleanup:
cleanup:
git_
buf
_dispose
(
&
contents
);
git_
str
_dispose
(
&
contents
);
return
error
;
return
error
;
}
}
...
...
src/libgit2/libgit2.c
View file @
cfc2ae68
...
@@ -413,6 +413,8 @@ int git_libgit2_opts(int key, ...)
...
@@ -413,6 +413,8 @@ int git_libgit2_opts(int key, ...)
case
GIT_OPT_SET_OWNER_VALIDATION
:
case
GIT_OPT_SET_OWNER_VALIDATION
:
git_repository__validate_ownership
=
(
va_arg
(
ap
,
int
)
!=
0
);
git_repository__validate_ownership
=
(
va_arg
(
ap
,
int
)
!=
0
);
break
;
case
GIT_OPT_ENABLE_SHALLOW
:
case
GIT_OPT_ENABLE_SHALLOW
:
git_shallow__enabled
=
(
va_arg
(
ap
,
int
)
!=
0
);
git_shallow__enabled
=
(
va_arg
(
ap
,
int
)
!=
0
);
break
;
break
;
...
...
src/libgit2/repository.c
View file @
cfc2ae68
...
@@ -732,10 +732,10 @@ out:
...
@@ -732,10 +732,10 @@ out:
static
int
load_grafts
(
git_repository
*
repo
)
static
int
load_grafts
(
git_repository
*
repo
)
{
{
git_
buf
path
=
GIT_BUF
_INIT
;
git_
str
path
=
GIT_STR
_INIT
;
int
error
;
int
error
;
if
((
error
=
git_repository_item_path
(
&
path
,
repo
,
GIT_REPOSITORY_ITEM_INFO
))
<
0
||
if
((
error
=
git_repository_
_
item_path
(
&
path
,
repo
,
GIT_REPOSITORY_ITEM_INFO
))
<
0
||
(
error
=
git_str_joinpath
(
&
path
,
path
.
ptr
,
"grafts"
))
<
0
||
(
error
=
git_str_joinpath
(
&
path
,
path
.
ptr
,
"grafts"
))
<
0
||
(
error
=
git_grafts_from_file
(
&
repo
->
grafts
,
path
.
ptr
))
<
0
)
(
error
=
git_grafts_from_file
(
&
repo
->
grafts
,
path
.
ptr
))
<
0
)
goto
error
;
goto
error
;
...
@@ -747,7 +747,7 @@ static int load_grafts(git_repository *repo)
...
@@ -747,7 +747,7 @@ static int load_grafts(git_repository *repo)
goto
error
;
goto
error
;
error:
error:
git_
buf
_dispose
(
&
path
);
git_
str
_dispose
(
&
path
);
return
error
;
return
error
;
}
}
...
...
tests/grafts/basic.c
→
tests/
libgit2/
grafts/basic.c
View file @
cfc2ae68
File moved
tests/grafts/parse.c
→
tests/
libgit2/
grafts/parse.c
View file @
cfc2ae68
File moved
tests/grafts/shallow.c
→
tests/
libgit2/
grafts/shallow.c
View file @
cfc2ae68
File moved
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