|
|
@ -992,6 +992,7 @@ static void diagnose_invalid_index_path(int stage, |
|
|
|
pos = cache_name_pos(filename, namelen); |
|
|
|
pos = cache_name_pos(filename, namelen); |
|
|
|
if (pos < 0) |
|
|
|
if (pos < 0) |
|
|
|
pos = -pos - 1; |
|
|
|
pos = -pos - 1; |
|
|
|
|
|
|
|
if (pos < active_nr) { |
|
|
|
ce = active_cache[pos]; |
|
|
|
ce = active_cache[pos]; |
|
|
|
if (ce_namelen(ce) == namelen && |
|
|
|
if (ce_namelen(ce) == namelen && |
|
|
|
!memcmp(ce->name, filename, namelen)) |
|
|
|
!memcmp(ce->name, filename, namelen)) |
|
|
@ -999,6 +1000,7 @@ static void diagnose_invalid_index_path(int stage, |
|
|
|
"Did you mean ':%d:%s'?", |
|
|
|
"Did you mean ':%d:%s'?", |
|
|
|
filename, stage, |
|
|
|
filename, stage, |
|
|
|
ce_stage(ce), filename); |
|
|
|
ce_stage(ce), filename); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Confusion between relative and absolute filenames? */ |
|
|
|
/* Confusion between relative and absolute filenames? */ |
|
|
|
fullnamelen = namelen + strlen(prefix); |
|
|
|
fullnamelen = namelen + strlen(prefix); |
|
|
@ -1008,6 +1010,7 @@ static void diagnose_invalid_index_path(int stage, |
|
|
|
pos = cache_name_pos(fullname, fullnamelen); |
|
|
|
pos = cache_name_pos(fullname, fullnamelen); |
|
|
|
if (pos < 0) |
|
|
|
if (pos < 0) |
|
|
|
pos = -pos - 1; |
|
|
|
pos = -pos - 1; |
|
|
|
|
|
|
|
if (pos < active_nr) { |
|
|
|
ce = active_cache[pos]; |
|
|
|
ce = active_cache[pos]; |
|
|
|
if (ce_namelen(ce) == fullnamelen && |
|
|
|
if (ce_namelen(ce) == fullnamelen && |
|
|
|
!memcmp(ce->name, fullname, fullnamelen)) |
|
|
|
!memcmp(ce->name, fullname, fullnamelen)) |
|
|
@ -1015,6 +1018,7 @@ static void diagnose_invalid_index_path(int stage, |
|
|
|
"Did you mean ':%d:%s'?", |
|
|
|
"Did you mean ':%d:%s'?", |
|
|
|
fullname, filename, |
|
|
|
fullname, filename, |
|
|
|
ce_stage(ce), fullname); |
|
|
|
ce_stage(ce), fullname); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!lstat(filename, &st)) |
|
|
|
if (!lstat(filename, &st)) |
|
|
|
die("Path '%s' exists on disk, but not in the index.", filename); |
|
|
|
die("Path '%s' exists on disk, but not in the index.", filename); |
|
|
|