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
7bfdd1c2
Commit
7bfdd1c2
authored
Jun 30, 2015
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3270 from ethomson/warnings2
Remove some warnings
parents
4a0313bc
64c415c2
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
14 additions
and
16 deletions
+14
-16
examples/blame.c
+2
-2
examples/network/clone.c
+2
-0
src/iterator.c
+0
-5
src/odb.c
+1
-1
src/openssl_stream.c
+1
-0
src/stash.c
+1
-2
src/submodule.c
+1
-1
tests/checkout/index.c
+1
-1
tests/clar/sandbox.h
+1
-1
tests/filter/file.c
+2
-2
tests/index/racy.c
+1
-0
tests/stash/apply.c
+1
-1
No files found.
examples/blame.c
View file @
7bfdd1c2
...
...
@@ -37,8 +37,8 @@ static void parse_opts(struct opts *o, int argc, char *argv[]);
int
main
(
int
argc
,
char
*
argv
[])
{
int
i
,
line
,
break_on_null_hunk
;
size_t
rawsize
;
int
line
,
break_on_null_hunk
;
size_t
i
,
rawsize
;
char
spec
[
1024
]
=
{
0
};
struct
opts
o
=
{
0
};
const
char
*
rawdata
;
...
...
examples/network/clone.c
View file @
7bfdd1c2
...
...
@@ -48,6 +48,8 @@ static void print_progress(const progress_data *pd)
static
int
sideband_progress
(
const
char
*
str
,
int
len
,
void
*
payload
)
{
(
void
)
payload
;
// unused
printf
(
"remote: %*s"
,
len
,
str
);
fflush
(
stdout
);
return
0
;
...
...
src/iterator.c
View file @
7bfdd1c2
...
...
@@ -1852,7 +1852,6 @@ int git_iterator_walk(
const
git_index_entry
**
iterator_item
;
/* next in each iterator */
const
git_index_entry
**
cur_items
;
/* current path in each iter */
const
git_index_entry
*
first_match
;
int
cur_item_modified
;
size_t
i
,
j
;
int
error
=
0
;
...
...
@@ -1875,7 +1874,6 @@ int git_iterator_walk(
cur_items
[
i
]
=
NULL
;
first_match
=
NULL
;
cur_item_modified
=
0
;
/* Find the next path(s) to consume from each iterator */
for
(
i
=
0
;
i
<
cnt
;
i
++
)
{
...
...
@@ -1898,9 +1896,6 @@ int git_iterator_walk(
first_match
=
iterator_item
[
i
];
cur_items
[
i
]
=
iterator_item
[
i
];
}
else
if
(
path_diff
>
0
)
{
/* No entry for the current item, this is modified */
cur_item_modified
=
1
;
}
else
if
(
path_diff
==
0
)
{
cur_items
[
i
]
=
iterator_item
[
i
];
}
...
...
src/odb.c
View file @
7bfdd1c2
...
...
@@ -53,7 +53,7 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
int
git_odb__format_object_header
(
char
*
hdr
,
size_t
n
,
git_off_t
obj_len
,
git_otype
obj_type
)
{
const
char
*
type_str
=
git_object_type2string
(
obj_type
);
int
len
=
p_snprintf
(
hdr
,
n
,
"%s %lld"
,
type_str
,
obj_len
);
int
len
=
p_snprintf
(
hdr
,
n
,
"%s %lld"
,
type_str
,
(
long
long
)
obj_len
);
assert
(
len
>
0
&&
len
<=
(
int
)
n
);
return
len
+
1
;
}
...
...
src/openssl_stream.c
View file @
7bfdd1c2
...
...
@@ -413,6 +413,7 @@ void openssl_free(git_stream *stream)
{
openssl_stream
*
st
=
(
openssl_stream
*
)
stream
;
git__free
(
st
->
host
);
git__free
(
st
->
cert_info
.
data
);
git_stream_free
(
st
->
io
);
git__free
(
st
);
...
...
src/stash.c
View file @
7bfdd1c2
...
...
@@ -793,7 +793,6 @@ static int stage_new_file(const git_index_entry **entries, void *data)
static
int
stage_new_files
(
git_index
**
out
,
git_repository
*
repo
,
git_tree
*
parent_tree
,
git_tree
*
tree
)
{
...
...
@@ -886,7 +885,7 @@ int git_stash_apply(
*/
}
else
if
((
opts
.
flags
&
GIT_STASH_APPLY_REINSTATE_INDEX
)
==
0
)
{
if
((
error
=
stage_new_files
(
&
stash_adds
,
repo
,
stash_parent_tree
,
stash_tree
))
<
0
||
&
stash_adds
,
stash_parent_tree
,
stash_tree
))
<
0
||
(
error
=
merge_indexes
(
&
unstashed_index
,
repo
,
stash_parent_tree
,
repo_index
,
stash_adds
))
<
0
)
goto
cleanup
;
...
...
src/submodule.c
View file @
7bfdd1c2
...
...
@@ -749,7 +749,7 @@ const char *git_submodule_update_to_str(git_submodule_update_t update)
{
int
i
;
for
(
i
=
0
;
i
<
(
int
)
ARRAY_SIZE
(
_sm_update_map
);
++
i
)
if
(
_sm_update_map
[
i
].
map_value
==
update
)
if
(
_sm_update_map
[
i
].
map_value
==
(
int
)
update
)
return
_sm_update_map
[
i
].
str_match
;
return
NULL
;
}
...
...
tests/checkout/index.c
View file @
7bfdd1c2
...
...
@@ -145,7 +145,7 @@ void test_checkout_index__honor_coresymlinks_default(void)
const
char
*
url
=
git_repository_path
(
g_repo
);
getcwd
(
cwd
,
sizeof
(
cwd
)
);
cl_assert
(
getcwd
(
cwd
,
sizeof
(
cwd
))
!=
NULL
);
cl_assert_equal_i
(
0
,
p_mkdir
(
"readonly"
,
0555
));
// Read-only directory
cl_assert_equal_i
(
0
,
chdir
(
"readonly"
));
cl_git_pass
(
git_repository_init
(
&
repo
,
"../symlink.git"
,
true
));
...
...
tests/clar/sandbox.h
View file @
7bfdd1c2
...
...
@@ -65,7 +65,7 @@ static void clar_unsandbox(void)
if
(
_clar_path
[
0
]
==
'\0'
)
return
;
c
hdir
(
".."
);
c
l_must_pass
(
chdir
(
".."
)
);
fs_rm
(
_clar_path
);
}
...
...
tests/filter/file.c
View file @
7bfdd1c2
...
...
@@ -91,9 +91,9 @@ void test_filter_file__apply_stream(void)
cl_git_pass
(
git_filter_list_push
(
fl
,
crlf
,
NULL
));
cl_git_pass
(
git_filter_list_stream_file
(
fl
,
g_repo
,
"all-crlf"
,
(
git_writestream
*
)
&
write_target
));
cl_git_pass
(
git_filter_list_stream_file
(
fl
,
g_repo
,
"all-crlf"
,
&
write_target
.
base
));
cl_assert_equal_s
(
"crlf
\n
crlf
\n
crlf
\n
crlf
\n
"
,
write_target
.
buf
.
ptr
);
git_filter_list_free
(
fl
);
write_target
.
base
.
free
(
(
struct
git_writestream
*
)
&
write_target
);
write_target
.
base
.
free
(
&
write_target
.
base
);
}
tests/index/racy.c
View file @
7bfdd1c2
...
...
@@ -3,6 +3,7 @@
#include "buffer.h"
#include "index.h"
#include "repository.h"
static
git_repository
*
g_repo
;
...
...
tests/stash/apply.c
View file @
7bfdd1c2
...
...
@@ -96,7 +96,7 @@ void test_stash_apply__with_existing_file(void)
void
test_stash_apply__merges_new_file
(
void
)
{
git_index_entry
*
ancestor
,
*
our
,
*
their
;
const
git_index_entry
*
ancestor
,
*
our
,
*
their
;
cl_git_mkfile
(
"stash/where"
,
"committed before stash
\n
"
);
cl_git_pass
(
git_index_add_bypath
(
repo_index
,
"where"
));
...
...
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