Skip to content

Commit 2960a1d

Browse files
author
Junio C Hamano
committed
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 <[email protected]>
1 parent 9a4d8fd commit 2960a1d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin-read-tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
228228
if (0 <= pos)
229229
die("file '%.*s' already exists.",
230230
pfxlen-1, opts.prefix);
231+
opts.pos = -1 - pos;
231232
}
232233

233234
if (opts.merge) {

0 commit comments

Comments
 (0)