Fix read-tree --prefix=dir/.

The existing code is not wrong per-se, but it started scanning the index
from a location that does not match the tree being read, and wasted
cycles.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2007-04-02 12:40:19 -07:00
parent 9a4d8fdc25
commit 2960a1d9ee

View file

@ -228,6 +228,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
if (0 <= pos)
die("file '%.*s' already exists.",
pfxlen-1, opts.prefix);
opts.pos = -1 - pos;
}
if (opts.merge) {