aboutsummaryrefslogtreecommitdiff
path: root/builtin-read-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-04-02 12:40:19 -0700
committerJunio C Hamano <junkio@cox.net>2007-04-04 00:19:29 -0700
commit2960a1d9eef846de9cfd9d6e32d203339d792120 (patch)
tree8dcf6d0e1a4bca4288921c573464541298efe6be /builtin-read-tree.c
parent9a4d8fdc25d6ba08564766c6ded165212f423b61 (diff)
downloadgit-2960a1d9eef846de9cfd9d6e32d203339d792120.tar.gz
git-2960a1d9eef846de9cfd9d6e32d203339d792120.tar.xz
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>
Diffstat (limited to 'builtin-read-tree.c')
-rw-r--r--builtin-read-tree.c1
1 files changed, 1 insertions, 0 deletions
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) {