Commit 0df3245
fast-import: do less work when given "from" matches current branch head
When building a fast-import stream, it's easy to forget the fact
that for non-merge commits happening on top of the current branch
head, there is no need for a "from" command. That is corroborated by
the fact that at least git-p4, hg-fast-export and felipec's
git-remote-hg all unconditionally use a "from" command.
Unfortunately, giving a "from" command always resets the branch
tree, forcing it to be re-read, and in many cases, the pack is also
closed and reopened through gfi_unpack_entry. Both are unnecessary
overhead, and the latter is particularly slow at least on OSX.
Avoid resetting the tree when it's unmodified, and avoid calling
gfi_unpack_entry when the given mark points to the same commit as
the current branch head.
Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 7ecec52 commit 0df3245
1 file changed
Lines changed: 17 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2588 | 2588 | | |
2589 | 2589 | | |
2590 | 2590 | | |
| 2591 | + | |
2591 | 2592 | | |
2592 | 2593 | | |
2593 | 2594 | | |
2594 | 2595 | | |
2595 | | - | |
2596 | | - | |
2597 | | - | |
2598 | | - | |
| 2596 | + | |
2599 | 2597 | | |
2600 | 2598 | | |
2601 | 2599 | | |
| |||
2610 | 2608 | | |
2611 | 2609 | | |
2612 | 2610 | | |
2613 | | - | |
2614 | | - | |
2615 | | - | |
2616 | | - | |
2617 | | - | |
2618 | | - | |
2619 | | - | |
2620 | | - | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
2621 | 2621 | | |
2622 | 2622 | | |
2623 | 2623 | | |
| |||
2626 | 2626 | | |
2627 | 2627 | | |
2628 | 2628 | | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
2629 | 2634 | | |
2630 | 2635 | | |
2631 | 2636 | | |
| |||
0 commit comments