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
f1f9b45d
Commit
f1f9b45d
authored
Aug 31, 2022
by
Yuang Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test failures
parent
b20f013c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
src/libgit2/fetch.c
+4
-2
src/libgit2/grafts.c
+2
-2
No files found.
src/libgit2/fetch.c
View file @
f1f9b45d
...
...
@@ -21,6 +21,7 @@
#include "repository.h"
#include "refs.h"
#include "transports/smart.h"
#include <limits.h>
static
int
maybe_want
(
git_remote
*
remote
,
git_remote_head
*
head
,
git_refspec
*
tagspec
,
git_remote_autotag_option_t
tagopt
)
{
...
...
@@ -175,7 +176,8 @@ int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts)
git_transport
*
t
=
remote
->
transport
;
remote
->
need_pack
=
0
;
remote
->
nego
.
depth
=
opts
->
unshallow
?
INT_MAX
:
opts
->
depth
;
remote
->
nego
.
depth
=
(
opts
&&
!
opts
->
unshallow
)
?
opts
->
depth
:
INT_MAX
;
if
(
filter_wants
(
remote
,
opts
)
<
0
)
return
-
1
;
...
...
@@ -184,7 +186,7 @@ int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts)
if
(
!
remote
->
need_pack
)
return
0
;
if
(
opts
->
unshallow
&&
opts
->
depth
>
0
)
{
if
(
opts
&&
opts
->
unshallow
&&
opts
->
depth
>
0
)
{
git_error_set
(
GIT_ERROR_INVALID
,
"options '--depth' and '--unshallow' cannot be used together"
);
return
-
1
;
}
...
...
src/libgit2/grafts.c
View file @
f1f9b45d
...
...
@@ -133,7 +133,7 @@ int git_grafts_parse(git_grafts *grafts, const char *content, size_t contentlen)
const
char
*
line_start
=
parser
.
line
,
*
line_end
=
parser
.
line
+
parser
.
line_len
;
git_oid
graft_oid
;
if
((
error
=
git_oid_
fromstrn
(
&
graft_oid
,
line_start
,
GIT_OID_SHA1_HEXSIZE
))
<
0
)
{
if
((
error
=
git_oid_
_fromstrn
(
&
graft_oid
,
line_start
,
GIT_OID_SHA1_HEXSIZE
,
GIT_OID_SHA1
))
<
0
)
{
git_error_set
(
GIT_ERROR_GRAFTS
,
"invalid graft OID at line %"
PRIuZ
,
parser
.
line_num
);
goto
error
;
}
...
...
@@ -143,7 +143,7 @@ int git_grafts_parse(git_grafts *grafts, const char *content, size_t contentlen)
git_oid
*
id
=
git_array_alloc
(
parents
);
GIT_ERROR_CHECK_ALLOC
(
id
);
if
((
error
=
git_oid_
fromstrn
(
id
,
++
line_start
,
GIT_OID_SHA1_HEXSIZE
))
<
0
)
{
if
((
error
=
git_oid_
_fromstrn
(
id
,
++
line_start
,
GIT_OID_SHA1_HEXSIZE
,
GIT_OID_SHA1
))
<
0
)
{
git_error_set
(
GIT_ERROR_GRAFTS
,
"invalid parent OID at line %"
PRIuZ
,
parser
.
line_num
);
goto
error
;
}
...
...
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