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
c9f116f1
Commit
c9f116f1
authored
May 12, 2019
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pr/5061'
parents
1e3a639d
ab27c835
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletions
+26
-1
src/revwalk.c
+8
-1
tests/revwalk/basic.c
+18
-0
No files found.
src/revwalk.c
View file @
c9f116f1
...
@@ -194,10 +194,17 @@ int git_revwalk_push_range(git_revwalk *walk, const char *range)
...
@@ -194,10 +194,17 @@ int git_revwalk_push_range(git_revwalk *walk, const char *range)
if
((
error
=
git_revparse
(
&
revspec
,
walk
->
repo
,
range
)))
if
((
error
=
git_revparse
(
&
revspec
,
walk
->
repo
,
range
)))
return
error
;
return
error
;
if
(
!
revspec
.
to
)
{
git_error_set
(
GIT_ERROR_INVALID
,
"invalid revspec: range not provided"
);
error
=
GIT_EINVALIDSPEC
;
goto
out
;
}
if
(
revspec
.
flags
&
GIT_REVPARSE_MERGE_BASE
)
{
if
(
revspec
.
flags
&
GIT_REVPARSE_MERGE_BASE
)
{
/* TODO: support "<commit>...<commit>" */
/* TODO: support "<commit>...<commit>" */
git_error_set
(
GIT_ERROR_INVALID
,
"symmetric differences not implemented in revwalk"
);
git_error_set
(
GIT_ERROR_INVALID
,
"symmetric differences not implemented in revwalk"
);
return
GIT_EINVALIDSPEC
;
error
=
GIT_EINVALIDSPEC
;
goto
out
;
}
}
if
((
error
=
push_commit
(
walk
,
git_object_id
(
revspec
.
from
),
1
,
false
)))
if
((
error
=
push_commit
(
walk
,
git_object_id
(
revspec
.
from
),
1
,
false
)))
...
...
tests/revwalk/basic.c
View file @
c9f116f1
...
@@ -400,6 +400,24 @@ void test_revwalk_basic__push_range(void)
...
@@ -400,6 +400,24 @@ void test_revwalk_basic__push_range(void)
cl_git_pass
(
test_walk_only
(
_walk
,
commit_sorting_segment
,
2
));
cl_git_pass
(
test_walk_only
(
_walk
,
commit_sorting_segment
,
2
));
}
}
void
test_revwalk_basic__push_range_merge_base
(
void
)
{
revwalk_basic_setup_walk
(
NULL
);
git_revwalk_reset
(
_walk
);
git_revwalk_sorting
(
_walk
,
0
);
cl_git_fail_with
(
GIT_EINVALIDSPEC
,
git_revwalk_push_range
(
_walk
,
"HEAD...HEAD~2"
));
}
void
test_revwalk_basic__push_range_no_range
(
void
)
{
revwalk_basic_setup_walk
(
NULL
);
git_revwalk_reset
(
_walk
);
git_revwalk_sorting
(
_walk
,
0
);
cl_git_fail_with
(
GIT_EINVALIDSPEC
,
git_revwalk_push_range
(
_walk
,
"HEAD"
));
}
void
test_revwalk_basic__push_mixed
(
void
)
void
test_revwalk_basic__push_mixed
(
void
)
{
{
git_oid
oid
;
git_oid
oid
;
...
...
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