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
62caf3f3
Commit
62caf3f3
authored
May 01, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report some errors returnable by push
parent
f063f578
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
src/push.c
+8
-6
No files found.
src/push.c
View file @
62caf3f3
...
...
@@ -303,7 +303,7 @@ static int revwalk(git_vector *commits, git_push *push)
continue
;
if
(
!
git_odb_exists
(
push
->
repo
->
_odb
,
&
spec
->
roid
))
{
giterr_
clear
(
);
giterr_
set
(
GITERR_REFERENCE
,
"Cannot push missing reference"
);
error
=
GIT_ENONFASTFORWARD
;
goto
on_error
;
}
...
...
@@ -313,7 +313,8 @@ static int revwalk(git_vector *commits, git_push *push)
if
(
error
==
GIT_ENOTFOUND
||
(
!
error
&&
!
git_oid_equal
(
&
base
,
&
spec
->
roid
)))
{
giterr_clear
();
giterr_set
(
GITERR_REFERENCE
,
"Cannot push non-fastforwardable reference"
);
error
=
GIT_ENONFASTFORWARD
;
goto
on_error
;
}
...
...
@@ -333,12 +334,13 @@ static int revwalk(git_vector *commits, git_push *push)
while
((
error
=
git_revwalk_next
(
&
oid
,
rw
))
==
0
)
{
git_oid
*
o
=
git__malloc
(
GIT_OID_RAWSZ
);
GITERR_CHECK_ALLOC
(
o
);
git_oid_cpy
(
o
,
&
oid
);
if
(
git_vector_insert
(
commits
,
o
)
<
0
)
{
if
(
!
o
)
{
error
=
-
1
;
goto
on_error
;
}
git_oid_cpy
(
o
,
&
oid
);
if
((
error
=
git_vector_insert
(
commits
,
o
))
<
0
)
goto
on_error
;
}
on_error:
...
...
@@ -519,7 +521,7 @@ static int calculate_work(git_push *push)
/* This is a create or update. Local ref must exist. */
if
(
git_reference_name_to_id
(
&
spec
->
loid
,
push
->
repo
,
spec
->
lref
)
<
0
)
{
giterr_set
(
GIT
_ENOTFOUND
,
"No such reference '%s'"
,
spec
->
lref
);
giterr_set
(
GIT
ERR_REFERENCE
,
"No such reference '%s'"
,
spec
->
lref
);
return
-
1
;
}
}
...
...
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