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
3ad05221
Commit
3ad05221
authored
Feb 05, 2013
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MSVC compilation warnings
Fix #1308
parent
d96aa8a9
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
10 deletions
+10
-10
src/branch.c
+1
-1
src/diff_output.c
+2
-2
src/diff_output.h
+1
-1
src/tree.c
+1
-1
tests-clar/clone/empty.c
+1
-1
tests-clar/diff/patch.c
+3
-3
tests-clar/refs/branches/trackingname.c
+1
-1
No files found.
src/branch.c
View file @
3ad05221
...
@@ -348,7 +348,7 @@ int git_branch_tracking_name(
...
@@ -348,7 +348,7 @@ int git_branch_tracking_name(
if
(
tracking_branch_name_out
)
if
(
tracking_branch_name_out
)
git_buf_copy_cstr
(
tracking_branch_name_out
,
buffer_size
,
&
buf
);
git_buf_copy_cstr
(
tracking_branch_name_out
,
buffer_size
,
&
buf
);
error
=
buf
.
size
+
1
;
error
=
(
int
)
buf
.
size
+
1
;
cleanup:
cleanup:
git_buf_free
(
&
buf
);
git_buf_free
(
&
buf
);
...
...
src/diff_output.c
View file @
3ad05221
...
@@ -1603,8 +1603,8 @@ int git_diff_patch_get_line_in_hunk(
...
@@ -1603,8 +1603,8 @@ int git_diff_patch_get_line_in_hunk(
if
(
line_origin
)
*
line_origin
=
line
->
origin
;
if
(
line_origin
)
*
line_origin
=
line
->
origin
;
if
(
content
)
*
content
=
line
->
ptr
;
if
(
content
)
*
content
=
line
->
ptr
;
if
(
content_len
)
*
content_len
=
line
->
len
;
if
(
content_len
)
*
content_len
=
line
->
len
;
if
(
old_lineno
)
*
old_lineno
=
line
->
oldno
;
if
(
old_lineno
)
*
old_lineno
=
(
int
)
line
->
oldno
;
if
(
new_lineno
)
*
new_lineno
=
line
->
newno
;
if
(
new_lineno
)
*
new_lineno
=
(
int
)
line
->
newno
;
return
0
;
return
0
;
...
...
src/diff_output.h
View file @
3ad05221
...
@@ -42,7 +42,7 @@ typedef struct diff_patch_line diff_patch_line;
...
@@ -42,7 +42,7 @@ typedef struct diff_patch_line diff_patch_line;
struct
diff_patch_line
{
struct
diff_patch_line
{
const
char
*
ptr
;
const
char
*
ptr
;
size_t
len
;
size_t
len
;
in
t
lines
,
oldno
,
newno
;
size_
t
lines
,
oldno
,
newno
;
char
origin
;
char
origin
;
};
};
...
...
src/tree.c
View file @
3ad05221
...
@@ -355,7 +355,7 @@ size_t git_tree_entrycount(const git_tree *tree)
...
@@ -355,7 +355,7 @@ size_t git_tree_entrycount(const git_tree *tree)
unsigned
int
git_treebuilder_entrycount
(
git_treebuilder
*
bld
)
unsigned
int
git_treebuilder_entrycount
(
git_treebuilder
*
bld
)
{
{
assert
(
bld
);
assert
(
bld
);
return
bld
->
entries
.
length
;
return
(
int
)
bld
->
entries
.
length
;
}
}
static
int
tree_error
(
const
char
*
str
,
const
char
*
path
)
static
int
tree_error
(
const
char
*
str
,
const
char
*
path
)
...
...
tests-clar/clone/empty.c
View file @
3ad05221
...
@@ -46,7 +46,7 @@ void test_clone_empty__can_clone_an_empty_local_repo_barely(void)
...
@@ -46,7 +46,7 @@ void test_clone_empty__can_clone_an_empty_local_repo_barely(void)
cl_assert_equal_i
(
GIT_ENOTFOUND
,
git_reference_lookup
(
&
ref
,
g_repo_cloned
,
local_name
));
cl_assert_equal_i
(
GIT_ENOTFOUND
,
git_reference_lookup
(
&
ref
,
g_repo_cloned
,
local_name
));
/* ...one can still retrieve the name of the remote tracking reference */
/* ...one can still retrieve the name of the remote tracking reference */
cl_assert_equal_i
(
strlen
(
"refs/remotes/origin/master"
)
+
1
,
cl_assert_equal_i
(
(
int
)
strlen
(
"refs/remotes/origin/master"
)
+
1U
,
git_branch_tracking_name
(
tracking_name
,
1024
,
g_repo_cloned
,
local_name
));
git_branch_tracking_name
(
tracking_name
,
1024
,
g_repo_cloned
,
local_name
));
}
}
...
...
tests-clar/diff/patch.c
View file @
3ad05221
...
@@ -251,13 +251,13 @@ static void check_single_patch_stats(
...
@@ -251,13 +251,13 @@ static void check_single_patch_stats(
cl_git_pass
(
git_diff_get_patch
(
&
patch
,
&
delta
,
diff
,
0
));
cl_git_pass
(
git_diff_get_patch
(
&
patch
,
&
delta
,
diff
,
0
));
cl_assert_equal_i
(
GIT_DELTA_MODIFIED
,
(
int
)
delta
->
status
);
cl_assert_equal_i
(
GIT_DELTA_MODIFIED
,
(
int
)
delta
->
status
);
cl_assert_equal_
i
(
hunks
,
(
int
)
git_diff_patch_num_hunks
(
patch
));
cl_assert_equal_
sz
(
hunks
,
git_diff_patch_num_hunks
(
patch
));
cl_git_pass
(
cl_git_pass
(
git_diff_patch_line_stats
(
NULL
,
&
actual_adds
,
&
actual_dels
,
patch
));
git_diff_patch_line_stats
(
NULL
,
&
actual_adds
,
&
actual_dels
,
patch
));
cl_assert_equal_
i
(
adds
,
actual_adds
);
cl_assert_equal_
sz
(
adds
,
actual_adds
);
cl_assert_equal_
i
(
dels
,
actual_dels
);
cl_assert_equal_
sz
(
dels
,
actual_dels
);
git_diff_patch_free
(
patch
);
git_diff_patch_free
(
patch
);
git_diff_list_free
(
diff
);
git_diff_list_free
(
diff
);
...
...
tests-clar/refs/branches/trackingname.c
View file @
3ad05221
...
@@ -37,6 +37,6 @@ void test_refs_branches_trackingname__can_retrieve_the_local_tracking_reference_
...
@@ -37,6 +37,6 @@ void test_refs_branches_trackingname__can_retrieve_the_local_tracking_reference_
void
test_refs_branches_trackingname__can_return_the_size_of_thelocal_tracking_reference_name_of_a_local_branch
(
void
)
void
test_refs_branches_trackingname__can_return_the_size_of_thelocal_tracking_reference_name_of_a_local_branch
(
void
)
{
{
cl_assert_equal_i
(
strlen
(
"refs/heads/master"
)
+
1
,
cl_assert_equal_i
(
(
int
)
strlen
(
"refs/heads/master"
)
+
1
,
git_branch_tracking_name
(
NULL
,
0
,
repo
,
"refs/heads/track-local"
));
git_branch_tracking_name
(
NULL
,
0
,
repo
,
"refs/heads/track-local"
));
}
}
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