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
64b402f8
Commit
64b402f8
authored
Apr 11, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
status: Remove status_old
This is Git yo. You can fetch stuff from the history if you need it.
parent
e1f6f94a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
82 deletions
+0
-82
src/status.c
+0
-82
No files found.
src/status.c
View file @
64b402f8
...
...
@@ -654,88 +654,6 @@ static int dirent_cb(void *state, git_buf *a)
}
}
static
int
status_cmp
(
const
void
*
a
,
const
void
*
b
)
{
const
struct
status_entry
*
entry_a
=
(
const
struct
status_entry
*
)(
a
);
const
struct
status_entry
*
entry_b
=
(
const
struct
status_entry
*
)(
b
);
return
strcmp
(
entry_a
->
path
,
entry_b
->
path
);
}
#define DEFAULT_SIZE 16
int
git_status_foreach_old
(
git_repository
*
repo
,
int
(
*
callback
)(
const
char
*
,
unsigned
int
,
void
*
),
void
*
payload
)
{
git_vector
entries
;
git_ignores
ignores
;
git_index
*
index
=
NULL
;
git_buf
temp_path
=
GIT_BUF_INIT
;
struct
status_st
dirent_st
=
{
0
};
int
error
=
0
;
unsigned
int
i
;
git_tree
*
tree
;
struct
status_entry
*
e
;
const
char
*
workdir
;
assert
(
repo
);
if
((
workdir
=
git_repository_workdir
(
repo
))
==
NULL
||
!
git_path_isdir
(
workdir
))
{
giterr_set
(
GITERR_OS
,
"Cannot get status - invalid working directory"
);
return
GIT_ENOTFOUND
;
}
if
((
error
=
git_repository_index__weakptr
(
&
index
,
repo
))
<
0
||
(
error
=
retrieve_head_tree
(
&
tree
,
repo
))
<
0
)
return
error
;
if
((
error
=
git_vector_init
(
&
entries
,
DEFAULT_SIZE
,
status_cmp
))
<
0
)
goto
exit
;
dirent_st
.
repo
=
repo
;
dirent_st
.
vector
=
&
entries
;
dirent_st
.
index
=
index
;
dirent_st
.
tree
=
tree
;
dirent_st
.
ignores
=
&
ignores
;
dirent_st
.
workdir_path_len
=
strlen
(
workdir
);
git_buf_init
(
&
dirent_st
.
head_tree_relative_path
,
0
);
dirent_st
.
head_tree_relative_path_len
=
0
;
dirent_st
.
tree_position
=
0
;
dirent_st
.
index_position
=
0
;
dirent_st
.
is_dir
=
1
;
git_buf_sets
(
&
temp_path
,
workdir
);
if
((
error
=
git_ignore__for_path
(
repo
,
""
,
dirent_st
.
ignores
))
<
0
)
goto
exit
;
error
=
alphasorted_futils_direach
(
&
temp_path
,
dirent_cb
,
&
dirent_st
);
if
(
!
error
)
error
=
dirent_cb
(
&
dirent_st
,
NULL
);
for
(
i
=
0
;
i
<
entries
.
length
;
++
i
)
{
e
=
(
struct
status_entry
*
)
git_vector_get
(
&
entries
,
i
);
if
(
!
error
)
error
=
callback
(
e
->
path
,
e
->
status_flags
,
payload
);
git__free
(
e
);
}
exit:
git_buf_free
(
&
dirent_st
.
head_tree_relative_path
);
git_buf_free
(
&
temp_path
);
git_vector_free
(
&
entries
);
git_ignore__free
(
&
ignores
);
git_tree_free
(
tree
);
return
error
;
}
static
int
recurse_tree_entry
(
git_tree
*
tree
,
struct
status_entry
*
e
,
const
char
*
path
)
{
char
*
dir_sep
;
...
...
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