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
20c1bca1
Commit
20c1bca1
authored
Aug 03, 2011
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #349 from MasterGrumpy/development
git_status_foreach issue
parents
42c5b64a
8f643ce8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
5 deletions
+1
-5
src/status.c
+1
-4
src/tree.c
+0
-1
No files found.
src/status.c
View file @
20c1bca1
...
@@ -61,7 +61,6 @@ static int status_srch(const void *key, const void *array_member)
...
@@ -61,7 +61,6 @@ static int status_srch(const void *key, const void *array_member)
static
int
find_status_entry
(
git_vector
*
entries
,
const
char
*
path
)
static
int
find_status_entry
(
git_vector
*
entries
,
const
char
*
path
)
{
{
git_vector_sort
(
entries
);
return
git_vector_bsearch2
(
entries
,
status_srch
,
path
);
return
git_vector_bsearch2
(
entries
,
status_srch
,
path
);
}
}
...
@@ -91,7 +90,7 @@ static void recurse_tree_entries(git_tree *tree, git_vector *entries, char *path
...
@@ -91,7 +90,7 @@ static void recurse_tree_entries(git_tree *tree, git_vector *entries, char *path
if
(
git_tree_lookup
(
&
subtree
,
tree
->
object
.
repo
,
&
tree_entry
->
oid
)
==
GIT_SUCCESS
)
{
if
(
git_tree_lookup
(
&
subtree
,
tree
->
object
.
repo
,
&
tree_entry
->
oid
)
==
GIT_SUCCESS
)
{
recurse_tree_entries
(
subtree
,
entries
,
file_path
);
recurse_tree_entries
(
subtree
,
entries
,
file_path
);
git_tree_close
(
subtree
);
git_tree_close
(
subtree
);
return
;
continue
;
}
}
if
((
idx
=
find_status_entry
(
entries
,
file_path
))
!=
GIT_ENOTFOUND
)
if
((
idx
=
find_status_entry
(
entries
,
file_path
))
!=
GIT_ENOTFOUND
)
...
@@ -247,7 +246,6 @@ int git_status_foreach(git_repository *repo, int (*callback)(const char *, unsig
...
@@ -247,7 +246,6 @@ int git_status_foreach(git_repository *repo, int (*callback)(const char *, unsig
unsigned
int
i
,
cnt
;
unsigned
int
i
,
cnt
;
git_index_entry
*
index_entry
;
git_index_entry
*
index_entry
;
char
temp_path
[
GIT_PATH_MAX
];
char
temp_path
[
GIT_PATH_MAX
];
git_oid
zero
;
int
error
;
int
error
;
git_tree
*
tree
;
git_tree
*
tree
;
struct
status_st
dirent_st
;
struct
status_st
dirent_st
;
...
@@ -284,7 +282,6 @@ int git_status_foreach(git_repository *repo, int (*callback)(const char *, unsig
...
@@ -284,7 +282,6 @@ int git_status_foreach(git_repository *repo, int (*callback)(const char *, unsig
strcpy
(
temp_path
,
repo
->
path_workdir
);
strcpy
(
temp_path
,
repo
->
path_workdir
);
git_futils_direach
(
temp_path
,
GIT_PATH_MAX
,
dirent_cb
,
&
dirent_st
);
git_futils_direach
(
temp_path
,
GIT_PATH_MAX
,
dirent_cb
,
&
dirent_st
);
memset
(
&
zero
,
0x0
,
sizeof
(
git_oid
));
for
(
i
=
0
;
i
<
entries
.
length
;
++
i
)
{
for
(
i
=
0
;
i
<
entries
.
length
;
++
i
)
{
e
=
(
struct
status_entry
*
)
git_vector_get
(
&
entries
,
i
);
e
=
(
struct
status_entry
*
)
git_vector_get
(
&
entries
,
i
);
...
...
src/tree.c
View file @
20c1bca1
...
@@ -426,7 +426,6 @@ static git_tree_entry *treebuilder_get(git_treebuilder *bld, const char *filenam
...
@@ -426,7 +426,6 @@ static git_tree_entry *treebuilder_get(git_treebuilder *bld, const char *filenam
if
(
build_ksearch
(
&
ksearch
,
filename
)
<
GIT_SUCCESS
)
if
(
build_ksearch
(
&
ksearch
,
filename
)
<
GIT_SUCCESS
)
return
NULL
;
return
NULL
;
sort_entries
(
bld
);
idx
=
git_vector_bsearch2
(
&
bld
->
entries
,
entry_search_cmp
,
&
ksearch
);
idx
=
git_vector_bsearch2
(
&
bld
->
entries
,
entry_search_cmp
,
&
ksearch
);
if
(
idx
==
GIT_ENOTFOUND
)
if
(
idx
==
GIT_ENOTFOUND
)
return
NULL
;
return
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