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
0f85c208
Commit
0f85c208
authored
Apr 29, 2013
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1512 from carlosmn/push-delete-only
Fix push for delete-only and add travis rules to test it
parents
78bf2944
fb42a22e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
.travis.yml
+4
-0
src/transports/smart_protocol.c
+18
-5
No files found.
.travis.yml
View file @
0f85c208
...
@@ -25,6 +25,10 @@ install:
...
@@ -25,6 +25,10 @@ install:
# Run the Build script
# Run the Build script
script
:
script
:
-
mkdir _temp
-
git init --bare _temp/test.git
-
git daemon --listen=localhost --export-all --enable=receive-pack --base-path=_temp _temp 2>/dev/null &
-
export GITTEST_REMOTE_URL="git://localhost/test.git"
-
mkdir _build
-
mkdir _build
-
cd _build
-
cd _build
-
cmake .. -DCMAKE_INSTALL_PREFIX=../_install $OPTIONS
-
cmake .. -DCMAKE_INSTALL_PREFIX=../_install $OPTIONS
...
...
src/transports/smart_protocol.c
View file @
0f85c208
...
@@ -807,13 +807,13 @@ int git_smart__push(git_transport *transport, git_push *push)
...
@@ -807,13 +807,13 @@ int git_smart__push(git_transport *transport, git_push *push)
transport_smart
*
t
=
(
transport_smart
*
)
transport
;
transport_smart
*
t
=
(
transport_smart
*
)
transport
;
git_smart_subtransport_stream
*
s
;
git_smart_subtransport_stream
*
s
;
git_buf
pktline
=
GIT_BUF_INIT
;
git_buf
pktline
=
GIT_BUF_INIT
;
int
error
=
-
1
;
int
error
=
-
1
,
need_pack
=
0
;
push_spec
*
spec
;
unsigned
int
i
;
#ifdef PUSH_DEBUG
#ifdef PUSH_DEBUG
{
{
git_remote_head
*
head
;
git_remote_head
*
head
;
push_spec
*
spec
;
unsigned
int
i
;
char
hex
[
41
];
hex
[
40
]
=
'\0'
;
char
hex
[
41
];
hex
[
40
]
=
'\0'
;
git_vector_foreach
(
&
push
->
remote
->
refs
,
i
,
head
)
{
git_vector_foreach
(
&
push
->
remote
->
refs
,
i
,
head
)
{
...
@@ -831,10 +831,23 @@ int git_smart__push(git_transport *transport, git_push *push)
...
@@ -831,10 +831,23 @@ int git_smart__push(git_transport *transport, git_push *push)
}
}
#endif
#endif
/*
* Figure out if we need to send a packfile; which is in all
* cases except when we only send delete commands
*/
git_vector_foreach
(
&
push
->
specs
,
i
,
spec
)
{
if
(
spec
->
lref
)
{
need_pack
=
1
;
break
;
}
}
if
(
git_smart__get_push_stream
(
t
,
&
s
)
<
0
||
if
(
git_smart__get_push_stream
(
t
,
&
s
)
<
0
||
gen_pktline
(
&
pktline
,
push
)
<
0
||
gen_pktline
(
&
pktline
,
push
)
<
0
||
s
->
write
(
s
,
git_buf_cstr
(
&
pktline
),
git_buf_len
(
&
pktline
))
<
0
||
s
->
write
(
s
,
git_buf_cstr
(
&
pktline
),
git_buf_len
(
&
pktline
))
<
0
)
git_packbuilder_foreach
(
push
->
pb
,
&
stream_thunk
,
s
)
<
0
)
goto
on_error
;
if
(
need_pack
&&
git_packbuilder_foreach
(
push
->
pb
,
&
stream_thunk
,
s
)
<
0
)
goto
on_error
;
goto
on_error
;
/* If we sent nothing or the server doesn't support report-status, then
/* If we sent nothing or the server doesn't support report-status, then
...
...
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