Commit a0be62c
notes-merge: use opendir/readdir instead of using read_directory()
notes_merge_commit() only needs to list all entries (non-recursively)
under a directory, which can be easily accomplished with
opendir/readdir and would be more lightweight than read_directory().
read_directory() is designed to list paths inside a working
directory. Using it outside of its scope may lead to undesired effects.
Apparently, one of the undesired effects of read_directory() is that it
doesn't deal with being given absolute paths. This creates problems for
notes_merge_commit() when git_path() returns an absolute path, which
happens when the current working directory is in a subdirectory of the
.git directory.
Originally-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Updated-by: Johan Herland <johan@herland.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 01bfec8 commit a0be62c
2 files changed
Lines changed: 31 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
690 | | - | |
| 690 | + | |
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
695 | | - | |
696 | | - | |
697 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
698 | 698 | | |
699 | 699 | | |
| 700 | + | |
700 | 701 | | |
| 702 | + | |
701 | 703 | | |
702 | | - | |
703 | | - | |
| 704 | + | |
| 705 | + | |
704 | 706 | | |
705 | 707 | | |
706 | 708 | | |
707 | 709 | | |
708 | 710 | | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
713 | 718 | | |
714 | | - | |
715 | 719 | | |
716 | 720 | | |
717 | | - | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
718 | 725 | | |
719 | | - | |
720 | | - | |
| 726 | + | |
| 727 | + | |
721 | 728 | | |
722 | 729 | | |
723 | 730 | | |
| 731 | + | |
724 | 732 | | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
729 | 737 | | |
730 | 738 | | |
731 | | - | |
| 739 | + | |
732 | 740 | | |
733 | 741 | | |
734 | 742 | | |
| 743 | + | |
735 | 744 | | |
736 | 745 | | |
737 | 746 | | |
| |||
740 | 749 | | |
741 | 750 | | |
742 | 751 | | |
743 | | - | |
| 752 | + | |
| 753 | + | |
744 | 754 | | |
745 | 755 | | |
746 | 756 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
561 | | - | |
| 561 | + | |
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
| |||
0 commit comments