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
0f4d9c03
Commit
0f4d9c03
authored
Jun 15, 2015
by
Pierre-Olivier Latour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Xcode 6.1 build warnings
parent
f621f087
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
17 deletions
+24
-17
src/diff_patch.c
+1
-1
src/diff_print.c
+0
-1
src/path.c
+2
-2
src/refs.c
+1
-1
tests/core/iconv.c
+3
-3
tests/diff/binary.c
+15
-9
tests/diff/diff_helpers.c
+2
-0
No files found.
src/diff_patch.c
View file @
0f4d9c03
...
@@ -285,7 +285,7 @@ done:
...
@@ -285,7 +285,7 @@ done:
static
int
diff_binary
(
git_diff_output
*
output
,
git_patch
*
patch
)
static
int
diff_binary
(
git_diff_output
*
output
,
git_patch
*
patch
)
{
{
git_diff_binary
binary
=
{
0
};
git_diff_binary
binary
=
{
{
0
}
};
const
char
*
old_data
=
patch
->
ofile
.
map
.
data
;
const
char
*
old_data
=
patch
->
ofile
.
map
.
data
;
const
char
*
new_data
=
patch
->
nfile
.
map
.
data
;
const
char
*
new_data
=
patch
->
nfile
.
map
.
data
;
size_t
old_len
=
patch
->
ofile
.
map
.
len
,
size_t
old_len
=
patch
->
ofile
.
map
.
len
,
...
...
src/diff_print.c
View file @
0f4d9c03
...
@@ -335,7 +335,6 @@ static int format_binary(
...
@@ -335,7 +335,6 @@ static int format_binary(
const
char
*
typename
=
type
==
GIT_DIFF_BINARY_DELTA
?
const
char
*
typename
=
type
==
GIT_DIFF_BINARY_DELTA
?
"delta"
:
"literal"
;
"delta"
:
"literal"
;
const
char
*
scan
,
*
end
;
const
char
*
scan
,
*
end
;
int
error
=
0
;
git_buf_printf
(
pi
->
buf
,
"%s %lu
\n
"
,
typename
,
inflatedlen
);
git_buf_printf
(
pi
->
buf
,
"%s %lu
\n
"
,
typename
,
inflatedlen
);
pi
->
line
.
num_lines
++
;
pi
->
line
.
num_lines
++
;
...
...
src/path.c
View file @
0f4d9c03
...
@@ -1045,7 +1045,7 @@ int git_path_direach(
...
@@ -1045,7 +1045,7 @@ int git_path_direach(
#endif
#endif
while
((
de
=
readdir
(
dir
))
!=
NULL
)
{
while
((
de
=
readdir
(
dir
))
!=
NULL
)
{
char
*
de_path
=
de
->
d_name
;
c
onst
c
har
*
de_path
=
de
->
d_name
;
size_t
de_len
=
strlen
(
de_path
);
size_t
de_len
=
strlen
(
de_path
);
if
(
git_path_is_dot_or_dotdot
(
de_path
))
if
(
git_path_is_dot_or_dotdot
(
de_path
))
...
@@ -1305,7 +1305,7 @@ int git_path_diriter_next(git_path_diriter *diriter)
...
@@ -1305,7 +1305,7 @@ int git_path_diriter_next(git_path_diriter *diriter)
#ifdef GIT_USE_ICONV
#ifdef GIT_USE_ICONV
if
((
diriter
->
flags
&
GIT_PATH_DIR_PRECOMPOSE_UNICODE
)
!=
0
&&
if
((
diriter
->
flags
&
GIT_PATH_DIR_PRECOMPOSE_UNICODE
)
!=
0
&&
(
error
=
git_path_iconv
(
&
diriter
->
ic
,
(
char
**
)
&
filename
,
&
filename_len
))
<
0
)
(
error
=
git_path_iconv
(
&
diriter
->
ic
,
&
filename
,
&
filename_len
))
<
0
)
return
error
;
return
error
;
#endif
#endif
...
...
src/refs.c
View file @
0f4d9c03
...
@@ -863,7 +863,7 @@ int git_reference__normalize_name(
...
@@ -863,7 +863,7 @@ int git_reference__normalize_name(
const
char
*
name
,
const
char
*
name
,
unsigned
int
flags
)
unsigned
int
flags
)
{
{
char
*
current
;
c
onst
c
har
*
current
;
int
segment_len
,
segments_count
=
0
,
error
=
GIT_EINVALIDSPEC
;
int
segment_len
,
segments_count
=
0
,
error
=
GIT_EINVALIDSPEC
;
unsigned
int
process_flags
;
unsigned
int
process_flags
;
bool
normalize
=
(
buf
!=
NULL
);
bool
normalize
=
(
buf
!=
NULL
);
...
...
tests/core/iconv.c
View file @
0f4d9c03
...
@@ -24,7 +24,7 @@ void test_core_iconv__cleanup(void)
...
@@ -24,7 +24,7 @@ void test_core_iconv__cleanup(void)
void
test_core_iconv__unchanged
(
void
)
void
test_core_iconv__unchanged
(
void
)
{
{
#ifdef GIT_USE_ICONV
#ifdef GIT_USE_ICONV
char
*
data
=
"Ascii data"
,
*
original
=
data
;
c
onst
c
har
*
data
=
"Ascii data"
,
*
original
=
data
;
size_t
datalen
=
strlen
(
data
);
size_t
datalen
=
strlen
(
data
);
cl_git_pass
(
git_path_iconv
(
&
ic
,
&
data
,
&
datalen
));
cl_git_pass
(
git_path_iconv
(
&
ic
,
&
data
,
&
datalen
));
...
@@ -38,7 +38,7 @@ void test_core_iconv__unchanged(void)
...
@@ -38,7 +38,7 @@ void test_core_iconv__unchanged(void)
void
test_core_iconv__decomposed_to_precomposed
(
void
)
void
test_core_iconv__decomposed_to_precomposed
(
void
)
{
{
#ifdef GIT_USE_ICONV
#ifdef GIT_USE_ICONV
char
*
data
=
nfd
;
c
onst
c
har
*
data
=
nfd
;
size_t
datalen
,
nfdlen
=
strlen
(
nfd
);
size_t
datalen
,
nfdlen
=
strlen
(
nfd
);
datalen
=
nfdlen
;
datalen
=
nfdlen
;
...
@@ -64,7 +64,7 @@ void test_core_iconv__decomposed_to_precomposed(void)
...
@@ -64,7 +64,7 @@ void test_core_iconv__decomposed_to_precomposed(void)
void
test_core_iconv__precomposed_is_unmodified
(
void
)
void
test_core_iconv__precomposed_is_unmodified
(
void
)
{
{
#ifdef GIT_USE_ICONV
#ifdef GIT_USE_ICONV
char
*
data
=
nfc
;
c
onst
c
har
*
data
=
nfc
;
size_t
datalen
=
strlen
(
nfc
);
size_t
datalen
=
strlen
(
nfc
);
cl_git_pass
(
git_path_iconv
(
&
ic
,
&
data
,
&
datalen
));
cl_git_pass
(
git_path_iconv
(
&
ic
,
&
data
,
&
datalen
));
...
...
tests/diff/binary.c
View file @
0f4d9c03
...
@@ -317,6 +317,8 @@ static int print_cb(
...
@@ -317,6 +317,8 @@ static int print_cb(
{
{
git_buf
*
buf
=
(
git_buf
*
)
payload
;
git_buf
*
buf
=
(
git_buf
*
)
payload
;
GIT_UNUSED
(
delta
);
if
(
hunk
)
if
(
hunk
)
git_buf_put
(
buf
,
hunk
->
header
,
hunk
->
header_len
);
git_buf_put
(
buf
,
hunk
->
header
,
hunk
->
header_len
);
...
@@ -382,6 +384,8 @@ static int file_cb(
...
@@ -382,6 +384,8 @@ static int file_cb(
{
{
struct
diff_data
*
diff_data
=
payload
;
struct
diff_data
*
diff_data
=
payload
;
GIT_UNUSED
(
progress
);
if
(
delta
->
old_file
.
path
)
if
(
delta
->
old_file
.
path
)
diff_data
->
old_path
=
git__strdup
(
delta
->
old_file
.
path
);
diff_data
->
old_path
=
git__strdup
(
delta
->
old_file
.
path
);
...
@@ -401,6 +405,8 @@ static int binary_cb(
...
@@ -401,6 +405,8 @@ static int binary_cb(
{
{
struct
diff_data
*
diff_data
=
payload
;
struct
diff_data
*
diff_data
=
payload
;
GIT_UNUSED
(
delta
);
git_buf_encode_base85
(
&
diff_data
->
old_binary_base85
,
git_buf_encode_base85
(
&
diff_data
->
old_binary_base85
,
binary
->
old_file
.
data
,
binary
->
old_file
.
datalen
);
binary
->
old_file
.
data
,
binary
->
old_file
.
datalen
);
diff_data
->
old_binary_inflatedlen
=
binary
->
old_file
.
inflatedlen
;
diff_data
->
old_binary_inflatedlen
=
binary
->
old_file
.
inflatedlen
;
...
@@ -419,6 +425,10 @@ static int hunk_cb(
...
@@ -419,6 +425,10 @@ static int hunk_cb(
const
git_diff_hunk
*
hunk
,
const
git_diff_hunk
*
hunk
,
void
*
payload
)
void
*
payload
)
{
{
GIT_UNUSED
(
delta
);
GIT_UNUSED
(
hunk
);
GIT_UNUSED
(
payload
);
cl_fail
(
"did not expect hunk callback"
);
cl_fail
(
"did not expect hunk callback"
);
return
0
;
return
0
;
}
}
...
@@ -429,6 +439,11 @@ static int line_cb(
...
@@ -429,6 +439,11 @@ static int line_cb(
const
git_diff_line
*
line
,
const
git_diff_line
*
line
,
void
*
payload
)
void
*
payload
)
{
{
GIT_UNUSED
(
delta
);
GIT_UNUSED
(
hunk
);
GIT_UNUSED
(
line
);
GIT_UNUSED
(
payload
);
cl_fail
(
"did not expect line callback"
);
cl_fail
(
"did not expect line callback"
);
return
0
;
return
0
;
}
}
...
@@ -440,15 +455,6 @@ void test_diff_binary__blob_to_blob(void)
...
@@ -440,15 +455,6 @@ void test_diff_binary__blob_to_blob(void)
git_blob
*
old_blob
,
*
new_blob
;
git_blob
*
old_blob
,
*
new_blob
;
git_oid
old_id
,
new_id
;
git_oid
old_id
,
new_id
;
struct
diff_data
diff_data
=
{
0
};
struct
diff_data
diff_data
=
{
0
};
const
char
*
expected
=
"diff --git a/untimely.txt b/untimely.txt
\n
"
\
"index 9a69d960ae94b060f56c2a8702545e2bb1abb935..1111d4f11f4b35bf6759e0fb714fe09731ef0840 100644
\n
"
\
"GIT binary patch
\n
"
\
"delta 32
\n
"
\
"nc%1vf+QYWt3zLL@hC)e3Vu?a>QDRl4f_G*?PG(-ZA}<#J$+QbW
\n
"
\
"
\n
"
\
"delta 7
\n
"
\
"Oc%18D`@*{63ljhg(E~C7
\n
"
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
|
GIT_DIFF_FORCE_BINARY
;
opts
.
flags
=
GIT_DIFF_SHOW_BINARY
|
GIT_DIFF_FORCE_BINARY
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
opts
.
id_abbrev
=
GIT_OID_HEXSZ
;
...
...
tests/diff/diff_helpers.c
View file @
0f4d9c03
...
@@ -164,6 +164,8 @@ int diff_foreach_via_iterator(
...
@@ -164,6 +164,8 @@ int diff_foreach_via_iterator(
{
{
size_t
d
,
num_d
=
git_diff_num_deltas
(
diff
);
size_t
d
,
num_d
=
git_diff_num_deltas
(
diff
);
GIT_UNUSED
(
binary_cb
);
for
(
d
=
0
;
d
<
num_d
;
++
d
)
{
for
(
d
=
0
;
d
<
num_d
;
++
d
)
{
git_patch
*
patch
;
git_patch
*
patch
;
const
git_diff_delta
*
delta
;
const
git_diff_delta
*
delta
;
...
...
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