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
584f2d30
Commit
584f2d30
authored
Jul 11, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warnings on Win64
parent
814de0bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
src/commit.c
+2
-1
src/diff_driver.c
+1
-1
tests-clar/diff/pathspec.c
+7
-7
No files found.
src/commit.c
View file @
584f2d30
...
@@ -163,7 +163,8 @@ int git_commit__parse(void *_commit, git_odb_object *odb_obj)
...
@@ -163,7 +163,8 @@ int git_commit__parse(void *_commit, git_odb_object *odb_obj)
const
char
*
buffer_start
=
git_odb_object_data
(
odb_obj
),
*
buffer
;
const
char
*
buffer_start
=
git_odb_object_data
(
odb_obj
),
*
buffer
;
const
char
*
buffer_end
=
buffer_start
+
git_odb_object_size
(
odb_obj
);
const
char
*
buffer_end
=
buffer_start
+
git_odb_object_size
(
odb_obj
);
git_oid
parent_id
;
git_oid
parent_id
;
size_t
parent_count
=
0
,
header_len
;
uint32_t
parent_count
=
0
;
size_t
header_len
;
/* find end-of-header (counting parents as we go) */
/* find end-of-header (counting parents as we go) */
for
(
buffer
=
buffer_start
;
buffer
<
buffer_end
;
++
buffer
)
{
for
(
buffer
=
buffer_start
;
buffer
<
buffer_end
;
++
buffer
)
{
...
...
src/diff_driver.c
View file @
584f2d30
...
@@ -374,7 +374,7 @@ static long diff_context_find(
...
@@ -374,7 +374,7 @@ static long diff_context_find(
return
-
1
;
return
-
1
;
if
(
out_size
>
(
long
)
ctxt
->
line
.
size
)
if
(
out_size
>
(
long
)
ctxt
->
line
.
size
)
out_size
=
ctxt
->
line
.
size
;
out_size
=
(
long
)
ctxt
->
line
.
size
;
memcpy
(
out
,
ctxt
->
line
.
ptr
,
(
size_t
)
out_size
);
memcpy
(
out
,
ctxt
->
line
.
ptr
,
(
size_t
)
out_size
);
return
out_size
;
return
out_size
;
...
...
tests-clar/diff/pathspec.c
View file @
584f2d30
...
@@ -34,7 +34,7 @@ void test_diff_pathspec__0(void)
...
@@ -34,7 +34,7 @@ void test_diff_pathspec__0(void)
cl_git_pass
(
git_pathspec_new
(
&
ps
,
&
paths
));
cl_git_pass
(
git_pathspec_new
(
&
ps
,
&
paths
));
cl_git_pass
(
git_pathspec_match_tree
(
&
matches
,
a
,
GIT_PATHSPEC_DEFAULT
,
ps
));
cl_git_pass
(
git_pathspec_match_tree
(
&
matches
,
a
,
GIT_PATHSPEC_DEFAULT
,
ps
));
cl_assert_equal_i
(
7
,
git_pathspec_match_list_entrycount
(
matches
));
cl_assert_equal_i
(
7
,
(
int
)
git_pathspec_match_list_entrycount
(
matches
));
cl_assert_equal_s
(
"current_file"
,
git_pathspec_match_list_entry
(
matches
,
0
));
cl_assert_equal_s
(
"current_file"
,
git_pathspec_match_list_entry
(
matches
,
0
));
cl_assert
(
git_pathspec_match_list_diff_entry
(
matches
,
0
)
==
NULL
);
cl_assert
(
git_pathspec_match_list_diff_entry
(
matches
,
0
)
==
NULL
);
git_pathspec_match_list_free
(
matches
);
git_pathspec_match_list_free
(
matches
);
...
@@ -43,13 +43,13 @@ void test_diff_pathspec__0(void)
...
@@ -43,13 +43,13 @@ void test_diff_pathspec__0(void)
cl_git_pass
(
git_pathspec_match_diff
(
cl_git_pass
(
git_pathspec_match_diff
(
&
matches
,
diff
,
GIT_PATHSPEC_DEFAULT
,
ps
));
&
matches
,
diff
,
GIT_PATHSPEC_DEFAULT
,
ps
));
cl_assert_equal_i
(
7
,
git_pathspec_match_list_entrycount
(
matches
));
cl_assert_equal_i
(
7
,
(
int
)
git_pathspec_match_list_entrycount
(
matches
));
cl_assert
(
git_pathspec_match_list_diff_entry
(
matches
,
0
)
!=
NULL
);
cl_assert
(
git_pathspec_match_list_diff_entry
(
matches
,
0
)
!=
NULL
);
cl_assert
(
git_pathspec_match_list_entry
(
matches
,
0
)
==
NULL
);
cl_assert
(
git_pathspec_match_list_entry
(
matches
,
0
)
==
NULL
);
cl_assert_equal_s
(
"current_file"
,
cl_assert_equal_s
(
"current_file"
,
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
new_file
.
path
);
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
new_file
.
path
);
cl_assert_equal_i
(
GIT_DELTA_ADDED
,
cl_assert_equal_i
(
GIT_DELTA_ADDED
,
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
status
);
(
int
)
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
status
);
git_pathspec_match_list_free
(
matches
);
git_pathspec_match_list_free
(
matches
);
git_diff_list_free
(
diff
);
git_diff_list_free
(
diff
);
...
@@ -59,13 +59,13 @@ void test_diff_pathspec__0(void)
...
@@ -59,13 +59,13 @@ void test_diff_pathspec__0(void)
cl_git_pass
(
git_pathspec_match_diff
(
cl_git_pass
(
git_pathspec_match_diff
(
&
matches
,
diff
,
GIT_PATHSPEC_DEFAULT
,
ps
));
&
matches
,
diff
,
GIT_PATHSPEC_DEFAULT
,
ps
));
cl_assert_equal_i
(
3
,
git_pathspec_match_list_entrycount
(
matches
));
cl_assert_equal_i
(
3
,
(
int
)
git_pathspec_match_list_entrycount
(
matches
));
cl_assert
(
git_pathspec_match_list_diff_entry
(
matches
,
0
)
!=
NULL
);
cl_assert
(
git_pathspec_match_list_diff_entry
(
matches
,
0
)
!=
NULL
);
cl_assert
(
git_pathspec_match_list_entry
(
matches
,
0
)
==
NULL
);
cl_assert
(
git_pathspec_match_list_entry
(
matches
,
0
)
==
NULL
);
cl_assert_equal_s
(
"subdir/current_file"
,
cl_assert_equal_s
(
"subdir/current_file"
,
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
new_file
.
path
);
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
new_file
.
path
);
cl_assert_equal_i
(
GIT_DELTA_DELETED
,
cl_assert_equal_i
(
GIT_DELTA_DELETED
,
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
status
);
(
int
)
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
status
);
git_pathspec_match_list_free
(
matches
);
git_pathspec_match_list_free
(
matches
);
git_diff_list_free
(
diff
);
git_diff_list_free
(
diff
);
...
@@ -75,13 +75,13 @@ void test_diff_pathspec__0(void)
...
@@ -75,13 +75,13 @@ void test_diff_pathspec__0(void)
cl_git_pass
(
git_pathspec_match_diff
(
cl_git_pass
(
git_pathspec_match_diff
(
&
matches
,
diff
,
GIT_PATHSPEC_DEFAULT
,
ps
));
&
matches
,
diff
,
GIT_PATHSPEC_DEFAULT
,
ps
));
cl_assert_equal_i
(
4
,
git_pathspec_match_list_entrycount
(
matches
));
cl_assert_equal_i
(
4
,
(
int
)
git_pathspec_match_list_entrycount
(
matches
));
cl_assert
(
git_pathspec_match_list_diff_entry
(
matches
,
0
)
!=
NULL
);
cl_assert
(
git_pathspec_match_list_diff_entry
(
matches
,
0
)
!=
NULL
);
cl_assert
(
git_pathspec_match_list_entry
(
matches
,
0
)
==
NULL
);
cl_assert
(
git_pathspec_match_list_entry
(
matches
,
0
)
==
NULL
);
cl_assert_equal_s
(
"modified_file"
,
cl_assert_equal_s
(
"modified_file"
,
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
new_file
.
path
);
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
new_file
.
path
);
cl_assert_equal_i
(
GIT_DELTA_MODIFIED
,
cl_assert_equal_i
(
GIT_DELTA_MODIFIED
,
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
status
);
(
int
)
git_pathspec_match_list_diff_entry
(
matches
,
0
)
->
status
);
git_pathspec_match_list_free
(
matches
);
git_pathspec_match_list_free
(
matches
);
git_diff_list_free
(
diff
);
git_diff_list_free
(
diff
);
...
...
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