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
0511b15c
Commit
0511b15c
authored
Mar 03, 2014
by
Vicent Marti
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2141 from ravselj/development
BUGFIX - Fetching twice from the same remote causes a segfault
parents
bb3687c5
b43f35fd
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
7 deletions
+19
-7
CMakeLists.txt
+4
-0
examples/add.c
+1
-1
examples/blame.c
+2
-1
examples/cat-file.c
+1
-1
examples/common.c
+1
-1
examples/network/clone.c
+1
-1
src/fetch.c
+3
-1
src/transports/smart_protocol.c
+4
-0
src/transports/ssh.c
+2
-1
No files found.
CMakeLists.txt
View file @
0511b15c
...
...
@@ -57,6 +57,10 @@ IF(MSVC)
# By default, libgit2 is built with WinHTTP. To use the built-in
# HTTP transport, invoke CMake with the "-DWINHTTP=OFF" argument.
OPTION
(
WINHTTP
"Use Win32 WinHTTP routines"
ON
)
ADD_DEFINITIONS
(
-D_SCL_SECURE_NO_WARNINGS
)
ADD_DEFINITIONS
(
-D_CRT_SECURE_NO_DEPRECATE
)
ADD_DEFINITIONS
(
-D_CRT_NONSTDC_NO_DEPRECATE
)
ENDIF
()
# This variable will contain the libraries we need to put into
...
...
examples/add.c
View file @
0511b15c
...
...
@@ -78,7 +78,7 @@ int print_matched_cb(const char *path, const char *matched_pathspec, void *paylo
git_status_t
status
;
(
void
)
matched_pathspec
;
if
(
git_status_file
(
&
status
,
p
.
repo
,
path
))
{
if
(
git_status_file
(
(
unsigned
int
*
)(
&
status
)
,
p
.
repo
,
path
))
{
return
-
1
;
//abort
}
...
...
examples/blame.c
View file @
0511b15c
...
...
@@ -107,8 +107,9 @@ int main(int argc, char *argv[])
if
(
break_on_null_hunk
&&
!
hunk
)
break
;
if
(
hunk
)
{
break_on_null_hunk
=
1
;
char
sig
[
128
]
=
{
0
};
break_on_null_hunk
=
1
;
git_oid_tostr
(
oid
,
10
,
&
hunk
->
final_commit_id
);
snprintf
(
sig
,
30
,
"%s <%s>"
,
hunk
->
final_signature
->
name
,
hunk
->
final_signature
->
email
);
...
...
examples/cat-file.c
View file @
0511b15c
...
...
@@ -42,7 +42,7 @@ static void print_signature(const char *header, const git_signature *sig)
static
void
show_blob
(
const
git_blob
*
blob
)
{
/* ? Does this need crlf filtering? */
fwrite
(
git_blob_rawcontent
(
blob
),
git_blob_rawsize
(
blob
),
1
,
stdout
);
fwrite
(
git_blob_rawcontent
(
blob
),
(
size_t
)
git_blob_rawsize
(
blob
),
1
,
stdout
);
}
/** Show each entry with its type, id and attributes */
...
...
examples/common.c
View file @
0511b15c
...
...
@@ -156,7 +156,7 @@ int diff_output(
const
git_diff_line
*
l
,
void
*
p
)
{
FILE
*
fp
=
p
;
FILE
*
fp
=
(
FILE
*
)
p
;
(
void
)
d
;
(
void
)
h
;
...
...
examples/network/clone.c
View file @
0511b15c
...
...
@@ -22,7 +22,7 @@ static void print_progress(const progress_data *pd)
int
index_percent
=
(
100
*
pd
->
fetch_progress
.
indexed_objects
)
/
pd
->
fetch_progress
.
total_objects
;
int
checkout_percent
=
pd
->
total_steps
>
0
?
(
100
*
pd
->
completed_steps
)
/
pd
->
total_steps
:
0
.
f
;
:
0
;
int
kbytes
=
pd
->
fetch_progress
.
received_bytes
/
1024
;
if
(
pd
->
fetch_progress
.
received_objects
==
pd
->
fetch_progress
.
total_objects
)
{
...
...
src/fetch.c
View file @
0511b15c
...
...
@@ -42,8 +42,10 @@ static int maybe_want(git_remote *remote, git_remote_head *head, git_odb *odb, g
return
0
;
/* If we have the object, mark it so we don't ask for it */
if
(
git_odb_exists
(
odb
,
&
head
->
oid
))
if
(
git_odb_exists
(
odb
,
&
head
->
oid
))
{
head
->
local
=
1
;
remote
->
need_pack
=
0
;
}
else
remote
->
need_pack
=
1
;
...
...
src/transports/smart_protocol.c
View file @
0511b15c
...
...
@@ -579,6 +579,10 @@ int git_smart__download_pack(
done:
if
(
writepack
)
writepack
->
free
(
writepack
);
if
(
progress_cb
)
{
t
->
packetsize_cb
=
NULL
;
t
->
packetsize_payload
=
NULL
;
}
return
error
;
}
...
...
src/transports/ssh.c
View file @
0511b15c
...
...
@@ -53,6 +53,7 @@ static void ssh_error(LIBSSH2_SESSION *session, const char *errmsg)
static
int
gen_proto
(
git_buf
*
request
,
const
char
*
cmd
,
const
char
*
url
)
{
char
*
repo
;
int
len
;
if
(
!
git__prefixcmp
(
url
,
prefix_ssh
))
{
url
=
url
+
strlen
(
prefix_ssh
);
...
...
@@ -67,7 +68,7 @@ static int gen_proto(git_buf *request, const char *cmd, const char *url)
return
-
1
;
}
int
len
=
strlen
(
cmd
)
+
1
/* Space */
+
1
/* Quote */
+
strlen
(
repo
)
+
1
/* Quote */
+
1
;
len
=
strlen
(
cmd
)
+
1
/* Space */
+
1
/* Quote */
+
strlen
(
repo
)
+
1
/* Quote */
+
1
;
git_buf_grow
(
request
,
len
);
git_buf_printf
(
request
,
"%s '%s'"
,
cmd
,
repo
);
...
...
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