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
03b51b5d
Commit
03b51b5d
authored
Mar 18, 2015
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2955 from git-up/update_tips_fixes
Update tips fixes
parents
83ad46f7
1034f1b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
src/push.c
+14
-13
src/remote.c
+4
-0
No files found.
src/push.c
View file @
03b51b5d
...
...
@@ -180,6 +180,10 @@ int git_push_update_tips(git_push *push)
git_vector_foreach
(
&
push
->
status
,
i
,
status
)
{
int
fire_callback
=
1
;
/* Skip unsuccessful updates which have non-empty messages */
if
(
status
->
msg
)
continue
;
/* Find the corresponding remote ref */
fetch_spec
=
git_remote__matching_refspec
(
push
->
remote
,
status
->
ref
);
if
(
!
fetch_spec
)
...
...
@@ -198,21 +202,18 @@ int git_push_update_tips(git_push *push)
if
(
j
==
push
->
specs
.
length
)
continue
;
/* If this ref update was successful (ok, not ng), it will have an empty message */
if
(
status
->
msg
==
NULL
)
{
/* Update the remote ref */
if
(
git_oid_iszero
(
&
push_spec
->
loid
))
{
error
=
git_reference_lookup
(
&
remote_ref
,
push
->
remote
->
repo
,
git_buf_cstr
(
&
remote_ref_name
));
/* Update the remote ref */
if
(
git_oid_iszero
(
&
push_spec
->
loid
))
{
error
=
git_reference_lookup
(
&
remote_ref
,
push
->
remote
->
repo
,
git_buf_cstr
(
&
remote_ref_name
));
if
(
error
>=
0
)
{
error
=
git_reference_delete
(
remote_ref
);
git_reference_free
(
remote_ref
);
}
}
else
{
error
=
git_reference_create
(
NULL
,
push
->
remote
->
repo
,
git_buf_cstr
(
&
remote_ref_name
),
&
push_spec
->
loid
,
1
,
"update by push"
);
if
(
error
>=
0
)
{
error
=
git_reference_delete
(
remote_ref
);
git_reference_free
(
remote_ref
);
}
}
else
{
error
=
git_reference_create
(
NULL
,
push
->
remote
->
repo
,
git_buf_cstr
(
&
remote_ref_name
),
&
push_spec
->
loid
,
1
,
"update by push"
);
}
if
(
error
<
0
)
{
...
...
src/remote.c
View file @
03b51b5d
...
...
@@ -2329,6 +2329,10 @@ int git_remote_upload(git_remote *remote, const git_strarray *refspecs, const gi
(
error
=
git_remote_connect
(
remote
,
GIT_DIRECTION_PUSH
))
<
0
)
goto
cleanup
;
free_refspecs
(
&
remote
->
active_refspecs
);
if
(
dwim_refspecs
(
&
remote
->
active_refspecs
,
&
remote
->
refspecs
,
&
remote
->
refs
)
<
0
)
goto
cleanup
;
if
(
remote
->
push
)
{
git_push_free
(
remote
->
push
);
remote
->
push
=
NULL
;
...
...
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