Commit 28eb7f6
worktree: refactor
This refactors `repair_worktree_after_gitdir_move()` to use the new
`write_worktree_linking_files` function. It also preserves the
relativity of the linking files; e.g., if an existing worktree used
absolute paths then the repaired paths will be absolute (and visa-versa).
`repair_worktree_after_gitdir_move()` is used to repair both sets of
worktree linking files if the `.git` directory is moved during a
re-initialization using `git init`.
This also adds a test case for reinitializing a repository that has
relative worktrees.
Signed-off-by: Caleb White <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>repair_worktree_after_gitdir_move()
1 parent 4f951f4 commit 28eb7f6
2 files changed
+26
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
437 | 443 | | |
438 | 444 | | |
439 | 445 | | |
| |||
442 | 448 | | |
443 | 449 | | |
444 | 450 | | |
445 | | - | |
446 | | - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
447 | 461 | | |
448 | 462 | | |
449 | | - | |
450 | | - | |
| 463 | + | |
| 464 | + | |
451 | 465 | | |
452 | 466 | | |
453 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
654 | | - | |
655 | | - | |
656 | 654 | | |
657 | 655 | | |
658 | | - | |
659 | | - | |
| 656 | + | |
660 | 657 | | |
661 | 658 | | |
662 | 659 | | |
663 | 660 | | |
664 | | - | |
665 | | - | |
| 661 | + | |
666 | 662 | | |
667 | | - | |
| 663 | + | |
668 | 664 | | |
669 | 665 | | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
675 | 670 | | |
676 | 671 | | |
677 | 672 | | |
678 | 673 | | |
679 | 674 | | |
680 | 675 | | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
| 676 | + | |
686 | 677 | | |
687 | | - | |
688 | | - | |
689 | 678 | | |
690 | 679 | | |
691 | | - | |
692 | | - | |
693 | 680 | | |
694 | 681 | | |
695 | 682 | | |
| |||
0 commit comments