summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 837e5fe)
raw | patch | inline | side by side (parent: 837e5fe)
author | Clemens Buchacher <drizzd@aon.at> | |
Thu, 1 Jan 2009 20:54:33 +0000 (21:54 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Jan 2009 20:48:43 +0000 (12:48 -0800) |
Since the only caller, verify_absent, relies on the fact that o->pos
points to the next index entry anyways, there is no need to recompute
its position.
Furthermore, if a nondirectory entry were found, this would return too
early, because there could still be an untracked directory in the way.
This is currently not a problem, because verify_absent is only called
if the index does not have this entry.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
points to the next index entry anyways, there is no need to recompute
its position.
Furthermore, if a nondirectory entry were found, this would return too
early, because there could still be an untracked directory in the way.
This is currently not a problem, because verify_absent is only called
if the index does not have this entry.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
unpack-trees.c | patch | blob | history |
diff --git a/unpack-trees.c b/unpack-trees.c
index 48e538ab7eb7b5f31813780d381a25cabbef02cc..556813eca824b2c88db07df5db96e3c95ac95a56 100644 (file)
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -493,7 +493,7 @@ static int verify_clean_subdirectory(struct cache_entry *ce, const char *action,
* anything in the existing directory there.
*/
int namelen;
- int pos, i;
+ int i;
struct dir_struct d;
char *pathbuf;
int cnt = 0;
@@ -514,11 +514,7 @@ static int verify_clean_subdirectory(struct cache_entry *ce, const char *action,
* in that directory.
*/
namelen = strlen(ce->name);
- pos = index_name_pos(o->src_index, ce->name, namelen);
- if (0 <= pos)
- return 0; /* we have it as nondirectory */
- pos = -pos - 1;
- for (i = pos; i < o->src_index->cache_nr; i++) {
+ for (i = o->pos; i < o->src_index->cache_nr; i++) {
struct cache_entry *ce2 = o->src_index->cache[i];
int len = ce_namelen(ce2);
if (len < namelen ||