From: Junio C Hamano Date: Mon, 2 Apr 2007 19:40:19 +0000 (-0700) Subject: Fix read-tree --prefix=dir/. X-Git-Tag: v1.5.2-rc0~73^2~2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=2960a1d9eef846de9cfd9d6e32d203339d792120;p=git.git 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 --- diff --git a/builtin-read-tree.c b/builtin-read-tree.c index 793eae0a5..5fb84b81a 100644 --- a/builtin-read-tree.c +++ b/builtin-read-tree.c @@ -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) {