Commit a4d4bba
mingw: lstat: compute correct size for symlinks
This commit fixes mingw_lstat by computing the proper size for symlinks
according to POSIX. POSIX specifies that upon successful return from
lstat: "the value of the st_size member shall be set to the length of
the pathname contained in the symbolic link not including any
terminating null byte".
Prior to this commit the mingw_lstat function returned a fixed size of
4096. This caused problems in git repositories that were accessed by
git for Cygwin or git for WSL. For example, doing `git reset --hard`
using git for Windows would update the size of symlinks in the index
to be 4096; at a later time git for Cygwin or git for WSL would find
that symlinks have changed size during `git status`. Vice versa doing
`git reset --hard` in git for Cygwin or git for WSL would update the
size of symlinks in the index with the correct value, only for git for
Windows to find incorrectly at a later time that the size had changed.
Signed-off-by: Bill Zissimopoulos <billziss@navimatics.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>1 parent 47cee2a commit a4d4bba
2 files changed
+56
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
822 | 825 | | |
823 | 826 | | |
824 | 827 | | |
825 | | - | |
| 828 | + | |
| 829 | + | |
826 | 830 | | |
827 | 831 | | |
828 | 832 | | |
| |||
837 | 841 | | |
838 | 842 | | |
839 | 843 | | |
840 | | - | |
| 844 | + | |
841 | 845 | | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
846 | 851 | | |
847 | 852 | | |
848 | 853 | | |
849 | 854 | | |
850 | 855 | | |
851 | 856 | | |
852 | | - | |
853 | | - | |
| 857 | + | |
| 858 | + | |
854 | 859 | | |
855 | 860 | | |
856 | 861 | | |
857 | 862 | | |
858 | 863 | | |
859 | 864 | | |
860 | 865 | | |
861 | | - | |
| 866 | + | |
862 | 867 | | |
863 | 868 | | |
864 | 869 | | |
| |||
2700 | 2705 | | |
2701 | 2706 | | |
2702 | 2707 | | |
2703 | | - | |
| 2708 | + | |
| 2709 | + | |
2704 | 2710 | | |
2705 | 2711 | | |
2706 | | - | |
| 2712 | + | |
2707 | 2713 | | |
2708 | 2714 | | |
2709 | | - | |
2710 | | - | |
2711 | | - | |
2712 | | - | |
2713 | | - | |
2714 | 2715 | | |
2715 | 2716 | | |
2716 | 2717 | | |
| |||
2730 | 2731 | | |
2731 | 2732 | | |
2732 | 2733 | | |
2733 | | - | |
| 2734 | + | |
2734 | 2735 | | |
2735 | 2736 | | |
2736 | 2737 | | |
| |||
2744 | 2745 | | |
2745 | 2746 | | |
2746 | 2747 | | |
2747 | | - | |
2748 | | - | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
2749 | 2755 | | |
2750 | 2756 | | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
2751 | 2776 | | |
2752 | 2777 | | |
2753 | 2778 | | |
2754 | 2779 | | |
2755 | 2780 | | |
2756 | 2781 | | |
2757 | 2782 | | |
2758 | | - | |
2759 | | - | |
2760 | 2783 | | |
2761 | 2784 | | |
2762 | 2785 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
585 | 597 | | |
586 | 598 | | |
587 | 599 | | |
| |||
0 commit comments