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
8bc5cacc
Commit
8bc5cacc
authored
Oct 01, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #961 from arrbee/win64-cleanups
Win64 cleanups
parents
93b5fabc
7c411fd9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
src/diff_output.c
+1
-1
src/refs.c
+6
-6
src/submodule.c
+1
-1
tests-clar/diff/diffiter.c
+6
-6
tests-clar/diff/tree.c
+1
-1
No files found.
src/diff_output.c
View file @
8bc5cacc
...
@@ -1366,7 +1366,7 @@ int git_diff_patch_num_lines_in_hunk(
...
@@ -1366,7 +1366,7 @@ int git_diff_patch_num_lines_in_hunk(
if
(
hunk_idx
>=
patch
->
hunks_size
)
if
(
hunk_idx
>=
patch
->
hunks_size
)
return
GIT_ENOTFOUND
;
return
GIT_ENOTFOUND
;
else
else
return
patch
->
hunks
[
hunk_idx
].
line_count
;
return
(
int
)
patch
->
hunks
[
hunk_idx
].
line_count
;
}
}
int
git_diff_patch_get_line_in_hunk
(
int
git_diff_patch_get_line_in_hunk
(
...
...
src/refs.c
View file @
8bc5cacc
...
@@ -1610,12 +1610,12 @@ static int ensure_segment_validity(const char *name)
...
@@ -1610,12 +1610,12 @@ static int ensure_segment_validity(const char *name)
prev
=
*
current
;
prev
=
*
current
;
}
}
return
current
-
name
;
return
(
int
)(
current
-
name
)
;
}
}
static
bool
is_all_caps_and_underscore
(
const
char
*
name
,
in
t
len
)
static
bool
is_all_caps_and_underscore
(
const
char
*
name
,
size_
t
len
)
{
{
in
t
i
;
size_
t
i
;
char
c
;
char
c
;
assert
(
name
&&
len
>
0
);
assert
(
name
&&
len
>
0
);
...
@@ -1667,10 +1667,10 @@ int git_reference__normalize_name(
...
@@ -1667,10 +1667,10 @@ int git_reference__normalize_name(
if
(
segment_len
>
0
)
{
if
(
segment_len
>
0
)
{
if
(
normalize
)
{
if
(
normalize
)
{
in
t
cur_len
=
git_buf_len
(
buf
);
size_
t
cur_len
=
git_buf_len
(
buf
);
git_buf_joinpath
(
buf
,
git_buf_cstr
(
buf
),
current
);
git_buf_joinpath
(
buf
,
git_buf_cstr
(
buf
),
current
);
git_buf_truncate
(
buf
,
git_buf_truncate
(
buf
,
cur_len
+
segment_len
+
(
segments_count
?
1
:
0
));
cur_len
+
segment_len
+
(
segments_count
?
1
:
0
));
if
(
git_buf_oom
(
buf
))
if
(
git_buf_oom
(
buf
))
...
@@ -1706,7 +1706,7 @@ int git_reference__normalize_name(
...
@@ -1706,7 +1706,7 @@ int git_reference__normalize_name(
goto
cleanup
;
goto
cleanup
;
if
((
segments_count
==
1
)
&&
if
((
segments_count
==
1
)
&&
!
(
is_all_caps_and_underscore
(
name
,
segment_len
)
||
!
(
is_all_caps_and_underscore
(
name
,
(
size_t
)
segment_len
)
||
((
flags
&
GIT_REF_FORMAT_REFSPEC_PATTERN
)
&&
!
strcmp
(
"*"
,
name
))))
((
flags
&
GIT_REF_FORMAT_REFSPEC_PATTERN
)
&&
!
strcmp
(
"*"
,
name
))))
goto
cleanup
;
goto
cleanup
;
...
...
src/submodule.c
View file @
8bc5cacc
...
@@ -1474,7 +1474,7 @@ static int submodule_wd_status(unsigned int *status, git_submodule *sm)
...
@@ -1474,7 +1474,7 @@ static int submodule_wd_status(unsigned int *status, git_submodule *sm)
error
=
git_diff_workdir_to_index
(
sm_repo
,
&
opt
,
&
diff
);
error
=
git_diff_workdir_to_index
(
sm_repo
,
&
opt
,
&
diff
);
if
(
!
error
)
{
if
(
!
error
)
{
in
t
untracked
=
size_
t
untracked
=
git_diff_num_deltas_of_type
(
diff
,
GIT_DELTA_UNTRACKED
);
git_diff_num_deltas_of_type
(
diff
,
GIT_DELTA_UNTRACKED
);
if
(
untracked
>
0
)
if
(
untracked
>
0
)
...
...
tests-clar/diff/diffiter.c
View file @
8bc5cacc
...
@@ -37,7 +37,7 @@ void test_diff_diffiter__iterate_files(void)
...
@@ -37,7 +37,7 @@ void test_diff_diffiter__iterate_files(void)
cl_git_pass
(
git_diff_workdir_to_index
(
repo
,
NULL
,
&
diff
));
cl_git_pass
(
git_diff_workdir_to_index
(
repo
,
NULL
,
&
diff
));
num_d
=
git_diff_num_deltas
(
diff
);
num_d
=
git_diff_num_deltas
(
diff
);
cl_assert_equal_i
(
6
,
num_d
);
cl_assert_equal_i
(
6
,
(
int
)
num_d
);
for
(
d
=
0
;
d
<
num_d
;
++
d
)
{
for
(
d
=
0
;
d
<
num_d
;
++
d
)
{
const
git_diff_delta
*
delta
;
const
git_diff_delta
*
delta
;
...
@@ -60,7 +60,7 @@ void test_diff_diffiter__iterate_files_2(void)
...
@@ -60,7 +60,7 @@ void test_diff_diffiter__iterate_files_2(void)
cl_git_pass
(
git_diff_workdir_to_index
(
repo
,
NULL
,
&
diff
));
cl_git_pass
(
git_diff_workdir_to_index
(
repo
,
NULL
,
&
diff
));
num_d
=
git_diff_num_deltas
(
diff
);
num_d
=
git_diff_num_deltas
(
diff
);
cl_assert_equal_i
(
8
,
num_d
);
cl_assert_equal_i
(
8
,
(
int
)
num_d
);
for
(
d
=
0
;
d
<
num_d
;
++
d
)
{
for
(
d
=
0
;
d
<
num_d
;
++
d
)
{
const
git_diff_delta
*
delta
;
const
git_diff_delta
*
delta
;
...
@@ -150,7 +150,7 @@ void test_diff_diffiter__max_size_threshold(void)
...
@@ -150,7 +150,7 @@ void test_diff_diffiter__max_size_threshold(void)
cl_assert
(
patch
);
cl_assert
(
patch
);
file_count
++
;
file_count
++
;
hunk_count
+=
git_diff_patch_num_hunks
(
patch
);
hunk_count
+=
(
int
)
git_diff_patch_num_hunks
(
patch
);
assert
(
delta
->
binary
==
0
||
delta
->
binary
==
1
);
assert
(
delta
->
binary
==
0
||
delta
->
binary
==
1
);
binary_count
+=
delta
->
binary
;
binary_count
+=
delta
->
binary
;
...
@@ -183,7 +183,7 @@ void test_diff_diffiter__max_size_threshold(void)
...
@@ -183,7 +183,7 @@ void test_diff_diffiter__max_size_threshold(void)
cl_git_pass
(
git_diff_get_patch
(
&
patch
,
&
delta
,
diff
,
d
));
cl_git_pass
(
git_diff_get_patch
(
&
patch
,
&
delta
,
diff
,
d
));
file_count
++
;
file_count
++
;
hunk_count
+=
git_diff_patch_num_hunks
(
patch
);
hunk_count
+=
(
int
)
git_diff_patch_num_hunks
(
patch
);
assert
(
delta
->
binary
==
0
||
delta
->
binary
==
1
);
assert
(
delta
->
binary
==
0
||
delta
->
binary
==
1
);
binary_count
+=
delta
->
binary
;
binary_count
+=
delta
->
binary
;
...
@@ -266,13 +266,13 @@ static void iterate_over_patch(git_diff_patch *patch, diff_expects *exp)
...
@@ -266,13 +266,13 @@ static void iterate_over_patch(git_diff_patch *patch, diff_expects *exp)
size_t
h
,
num_h
=
git_diff_patch_num_hunks
(
patch
),
num_l
;
size_t
h
,
num_h
=
git_diff_patch_num_hunks
(
patch
),
num_l
;
exp
->
files
++
;
exp
->
files
++
;
exp
->
hunks
+=
num_h
;
exp
->
hunks
+=
(
int
)
num_h
;
/* let's iterate in reverse, just because we can! */
/* let's iterate in reverse, just because we can! */
for
(
h
=
1
,
num_l
=
0
;
h
<=
num_h
;
++
h
)
for
(
h
=
1
,
num_l
=
0
;
h
<=
num_h
;
++
h
)
num_l
+=
git_diff_patch_num_lines_in_hunk
(
patch
,
num_h
-
h
);
num_l
+=
git_diff_patch_num_lines_in_hunk
(
patch
,
num_h
-
h
);
exp
->
lines
+=
num_l
;
exp
->
lines
+=
(
int
)
num_l
;
}
}
#define PATCH_CACHE 5
#define PATCH_CACHE 5
...
...
tests-clar/diff/tree.c
View file @
8bc5cacc
...
@@ -309,7 +309,7 @@ void test_diff_tree__larger_hunks(void)
...
@@ -309,7 +309,7 @@ void test_diff_tree__larger_hunks(void)
cl_git_fail
(
git_diff_get_patch
(
&
patch
,
&
delta
,
diff
,
num_d
));
cl_git_fail
(
git_diff_get_patch
(
&
patch
,
&
delta
,
diff
,
num_d
));
cl_assert_equal_i
(
2
,
num_d
);
cl_assert_equal_i
(
2
,
(
int
)
num_d
);
git_diff_list_free
(
diff
);
git_diff_list_free
(
diff
);
diff
=
NULL
;
diff
=
NULL
;
...
...
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