|
28 | 28 | * exists for ce that is a submodule -- it is a submodule that is not
|
29 | 29 | * checked out). Return negative for an error.
|
30 | 30 | */
|
31 |
| -static int check_removed(const struct index_state *istate, const struct cache_entry *ce, struct stat *st) |
| 31 | +static int check_removed(const struct cache_entry *ce, struct stat *st) |
32 | 32 | {
|
33 |
| - assert(is_fsmonitor_refreshed(istate)); |
34 |
| - if (!(ce->ce_flags & CE_FSMONITOR_VALID) && lstat(ce->name, st) < 0) { |
| 33 | + if (lstat(ce->name, st) < 0) { |
35 | 34 | if (!is_missing_file_error(errno))
|
36 | 35 | return -1;
|
37 | 36 | return 1;
|
38 | 37 | }
|
| 38 | + |
39 | 39 | if (has_symlink_leading_path(ce->name, ce_namelen(ce)))
|
40 | 40 | return 1;
|
41 | 41 | if (S_ISDIR(st->st_mode)) {
|
@@ -141,7 +141,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
|
141 | 141 | memset(&(dpath->parent[0]), 0,
|
142 | 142 | sizeof(struct combine_diff_parent)*5);
|
143 | 143 |
|
144 |
| - changed = check_removed(istate, ce, &st); |
| 144 | + changed = check_removed(ce, &st); |
145 | 145 | if (!changed)
|
146 | 146 | wt_mode = ce_mode_from_stat(ce, st.st_mode);
|
147 | 147 | else {
|
@@ -221,7 +221,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
|
221 | 221 | } else {
|
222 | 222 | struct stat st;
|
223 | 223 |
|
224 |
| - changed = check_removed(istate, ce, &st); |
| 224 | + changed = check_removed(ce, &st); |
225 | 225 | if (changed) {
|
226 | 226 | if (changed < 0) {
|
227 | 227 | perror(ce->name);
|
@@ -296,7 +296,7 @@ static int get_stat_data(const struct index_state *istate,
|
296 | 296 | if (!cached && !ce_uptodate(ce)) {
|
297 | 297 | int changed;
|
298 | 298 | struct stat st;
|
299 |
| - changed = check_removed(istate, ce, &st); |
| 299 | + changed = check_removed(ce, &st); |
300 | 300 | if (changed < 0)
|
301 | 301 | return -1;
|
302 | 302 | else if (changed) {
|
|
0 commit comments