|
|
@ -992,13 +992,15 @@ 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; |
|
|
|
ce = active_cache[pos]; |
|
|
|
if (pos < active_nr) { |
|
|
|
if (ce_namelen(ce) == namelen && |
|
|
|
ce = active_cache[pos]; |
|
|
|
!memcmp(ce->name, filename, namelen)) |
|
|
|
if (ce_namelen(ce) == namelen && |
|
|
|
die("Path '%s' is in the index, but not at stage %d.\n" |
|
|
|
!memcmp(ce->name, filename, namelen)) |
|
|
|
"Did you mean ':%d:%s'?", |
|
|
|
die("Path '%s' is in the index, but not at stage %d.\n" |
|
|
|
filename, stage, |
|
|
|
"Did you mean ':%d:%s'?", |
|
|
|
ce_stage(ce), filename); |
|
|
|
filename, stage, |
|
|
|
|
|
|
|
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,13 +1010,15 @@ 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; |
|
|
|
ce = active_cache[pos]; |
|
|
|
if (pos < active_nr) { |
|
|
|
if (ce_namelen(ce) == fullnamelen && |
|
|
|
ce = active_cache[pos]; |
|
|
|
!memcmp(ce->name, fullname, fullnamelen)) |
|
|
|
if (ce_namelen(ce) == fullnamelen && |
|
|
|
die("Path '%s' is in the index, but not '%s'.\n" |
|
|
|
!memcmp(ce->name, fullname, fullnamelen)) |
|
|
|
"Did you mean ':%d:%s'?", |
|
|
|
die("Path '%s' is in the index, but not '%s'.\n" |
|
|
|
fullname, filename, |
|
|
|
"Did you mean ':%d:%s'?", |
|
|
|
ce_stage(ce), fullname); |
|
|
|
fullname, filename, |
|
|
|
|
|
|
|
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); |
|
|
|