Commit a48b409
git_connect: clarify conn->use_shell flag
When executing user-specified programs, we generally always
want to use a shell, for flexibility and consistency. One
big exception is executing $GIT_SSH, which for historical
reasons must not use a shell.
Once upon a time the logic in git_connect looked like:
if (protocol == PROTO_SSH) {
... setup ssh ...
} else {
... setup local connection ...
conn->use_shell = 1;
}
But over time the PROTO_SSH block has grown, and the "local"
block has shrunk so that it contains only conn->use_shell;
it's easy to miss at the end of the large block. Moreover,
PROTO_SSH now also sometimes sets use_shell, when the new
GIT_SSH_COMMAND is used.
Let's just set conn->use_shell when we're setting up the "conn"
struct, and unset it (with a comment) in the historical GIT_SSH
case. This will make the flow easier to follow.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent aab4043 commit a48b409
1 file changed
+13
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
| 726 | + | |
726 | 727 | | |
727 | 728 | | |
728 | 729 | | |
729 | | - | |
| 730 | + | |
730 | 731 | | |
731 | 732 | | |
732 | 733 | | |
| |||
748 | 749 | | |
749 | 750 | | |
750 | 751 | | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
| 752 | + | |
755 | 753 | | |
756 | 754 | | |
757 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
758 | 763 | | |
759 | 764 | | |
760 | 765 | | |
| |||
764 | 769 | | |
765 | 770 | | |
766 | 771 | | |
767 | | - | |
768 | | - | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
769 | 775 | | |
770 | 776 | | |
771 | 777 | | |
| |||
779 | 785 | | |
780 | 786 | | |
781 | 787 | | |
782 | | - | |
783 | | - | |
784 | 788 | | |
785 | 789 | | |
786 | 790 | | |
| |||
0 commit comments