|
36 | 36 | * exists for ce that is a submodule -- it is a submodule that is not
|
37 | 37 | * checked out). Return negative for an error.
|
38 | 38 | */
|
39 |
| -static int check_removed(const struct index_state *istate, const struct cache_entry *ce, struct stat *st) |
| 39 | +static int check_removed(const struct cache_entry *ce, struct stat *st) |
40 | 40 | {
|
41 |
| - assert(is_fsmonitor_refreshed(istate)); |
42 |
| - if (!(ce->ce_flags & CE_FSMONITOR_VALID) && lstat(ce->name, st) < 0) { |
| 41 | + if (lstat(ce->name, st) < 0) { |
43 | 42 | if (!is_missing_file_error(errno))
|
44 | 43 | return -1;
|
45 | 44 | return 1;
|
46 | 45 | }
|
| 46 | + |
47 | 47 | if (has_symlink_leading_path(ce->name, ce_namelen(ce)))
|
48 | 48 | return 1;
|
49 | 49 | if (S_ISDIR(st->st_mode)) {
|
@@ -149,7 +149,7 @@ void run_diff_files(struct rev_info *revs, unsigned int option)
|
149 | 149 | memset(&(dpath->parent[0]), 0,
|
150 | 150 | sizeof(struct combine_diff_parent)*5);
|
151 | 151 |
|
152 |
| - changed = check_removed(istate, ce, &st); |
| 152 | + changed = check_removed(ce, &st); |
153 | 153 | if (!changed)
|
154 | 154 | wt_mode = ce_mode_from_stat(ce, st.st_mode);
|
155 | 155 | else {
|
@@ -229,7 +229,7 @@ void run_diff_files(struct rev_info *revs, unsigned int option)
|
229 | 229 | } else {
|
230 | 230 | struct stat st;
|
231 | 231 |
|
232 |
| - changed = check_removed(istate, ce, &st); |
| 232 | + changed = check_removed(ce, &st); |
233 | 233 | if (changed) {
|
234 | 234 | if (changed < 0) {
|
235 | 235 | perror(ce->name);
|
@@ -303,7 +303,7 @@ static int get_stat_data(const struct index_state *istate,
|
303 | 303 | if (!cached && !ce_uptodate(ce)) {
|
304 | 304 | int changed;
|
305 | 305 | struct stat st;
|
306 |
| - changed = check_removed(istate, ce, &st); |
| 306 | + changed = check_removed(ce, &st); |
307 | 307 | if (changed < 0)
|
308 | 308 | return -1;
|
309 | 309 | else if (changed) {
|
|
0 commit comments