Skip to content

Commit

Permalink
diff-lib.c: rename check_work_tree_entity()
Browse files Browse the repository at this point in the history
The function is about checking for removed work tree item, so name it
accordingly to avoid future confusion.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed May 5, 2008
1 parent 1392a37 commit 451244d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions diff-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ int run_diff_files_cmd(struct rev_info *revs, int argc, const char **argv)
* exists for ce that is a submodule -- it is a submodule that is not
* checked out). Return negative for an error.
*/
static int check_work_tree_entity(const struct cache_entry *ce, struct stat *st, char *symcache)
static int check_removed(const struct cache_entry *ce, struct stat *st, char *symcache)
{
if (lstat(ce->name, st) < 0) {
if (errno != ENOENT && errno != ENOTDIR)
Expand Down Expand Up @@ -421,7 +421,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
memset(&(dpath->parent[0]), 0,
sizeof(struct combine_diff_parent)*5);

changed = check_work_tree_entity(ce, &st, symcache);
changed = check_removed(ce, &st, symcache);
if (!changed)
dpath->mode = ce_mode_from_stat(ce, st.st_mode);
else {
Expand Down Expand Up @@ -485,7 +485,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
if (ce_uptodate(ce))
continue;

changed = check_work_tree_entity(ce, &st, symcache);
changed = check_removed(ce, &st, symcache);
if (changed) {
if (changed < 0) {
perror(ce->name);
Expand Down Expand Up @@ -543,7 +543,7 @@ static int get_stat_data(struct cache_entry *ce,
if (!cached) {
int changed;
struct stat st;
changed = check_work_tree_entity(ce, &st, cbdata->symcache);
changed = check_removed(ce, &st, cbdata->symcache);
if (changed < 0)
return -1;
else if (changed) {
Expand Down

0 comments on commit 451244d

Please sign in to comment.