Commit 01017dc
setup_git_directory_gently_1(): avoid die()ing
This function now has a new caller in addition to setup_git_directory():
the newly introduced discover_git_directory(). That function wants to
discover the current .git/ directory, and in case of a corrupted one
simply pretend that there is none to be found.
Example: if a stale .git file exists in the parent directory, and the
user calls `git -p init`, we want Git to simply *not* read any
repository config for the pager (instead of aborting with a message that
the .git file is corrupt).
Let's actually pretend that there was no GIT_DIR to be found in that case
when being called from discover_git_directory(), but keep the previous
behavior (i.e. to die()) for the setup_git_directory() case.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 1a6ec1e commit 01017dc
1 file changed
Lines changed: 17 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
825 | 825 | | |
826 | 826 | | |
827 | 827 | | |
828 | | - | |
| 828 | + | |
| 829 | + | |
829 | 830 | | |
830 | 831 | | |
831 | 832 | | |
| |||
842 | 843 | | |
843 | 844 | | |
844 | 845 | | |
845 | | - | |
| 846 | + | |
| 847 | + | |
846 | 848 | | |
847 | 849 | | |
848 | 850 | | |
| |||
890 | 892 | | |
891 | 893 | | |
892 | 894 | | |
893 | | - | |
| 895 | + | |
894 | 896 | | |
895 | 897 | | |
896 | 898 | | |
897 | 899 | | |
898 | | - | |
899 | | - | |
900 | | - | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
901 | 910 | | |
902 | 911 | | |
903 | 912 | | |
| |||
934 | 943 | | |
935 | 944 | | |
936 | 945 | | |
937 | | - | |
| 946 | + | |
938 | 947 | | |
939 | 948 | | |
940 | 949 | | |
| |||
994 | 1003 | | |
995 | 1004 | | |
996 | 1005 | | |
997 | | - | |
| 1006 | + | |
998 | 1007 | | |
999 | 1008 | | |
1000 | 1009 | | |
| |||
0 commit comments