convert: rename the "eol" global variable to "core_eol"

Yes, it is clear that "eol" wants to mean some sort of end-of-line thing, but as the name of a global variable, it is way too short to describe what kind of end-of-line thing it wants to represent. Besides, there are many codepaths that want to use their own local "char *eol" variable to point at the end of the current line they are processing. This global variable holds what we read from core.eol configuration variable. Name it as such. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed May 9, 2011 at 12:52 UTC ec70f52f6fb6d3e08c7b24f8b5bf25502d8ee59b
4 files changed +10 -10
cache.h
+1 -1
@@ -606,7 +606,7 @@ enum eol {
606 #endif
607 };
608
609 -extern enum eol eol;
609 +extern enum eol core_eol;
610
611 enum branch_track {
612 BRANCH_TRACK_UNSPECIFIED = -1,
config.c
+6 -6
@@ -583,7 +583,7 @@ static int git_default_core_config(const char *var, const char *value)
583
584 if (!strcmp(var, "core.autocrlf")) {
585 if (value && !strcasecmp(value, "input")) {
586 - if (eol == EOL_CRLF)
586 + if (core_eol == EOL_CRLF)
587 return error("core.autocrlf=input conflicts with core.eol=crlf");
588 auto_crlf = AUTO_CRLF_INPUT;
589 return 0;
@@ -603,14 +603,14 @@ static int git_default_core_config(const char *var, const char *value)
603
604 if (!strcmp(var, "core.eol")) {
605 if (value && !strcasecmp(value, "lf"))
606 - eol = EOL_LF;
606 + core_eol = EOL_LF;
607 else if (value && !strcasecmp(value, "crlf"))
608 - eol = EOL_CRLF;
608 + core_eol = EOL_CRLF;
609 else if (value && !strcasecmp(value, "native"))
610 - eol = EOL_NATIVE;
610 + core_eol = EOL_NATIVE;
611 else
612 - eol = EOL_UNSET;
613 - if (eol == EOL_CRLF && auto_crlf == AUTO_CRLF_INPUT)
612 + core_eol = EOL_UNSET;
613 + if (core_eol == EOL_CRLF && auto_crlf == AUTO_CRLF_INPUT)
614 return error("core.autocrlf=input conflicts with core.eol=crlf");
615 return 0;
616 }
convert.c
+2 -2
@@ -113,10 +113,10 @@ static enum eol determine_output_conversion(enum action action)
113 return EOL_CRLF;
114 else if (auto_crlf == AUTO_CRLF_INPUT)
115 return EOL_LF;
116 - else if (eol == EOL_UNSET)
116 + else if (core_eol == EOL_UNSET)
117 return EOL_NATIVE;
118 }
119 - return eol;
119 + return core_eol;
120 }
121
122 static void check_safe_crlf(const char *path, enum action action,
environment.c
+1 -1
@@ -43,7 +43,7 @@ const char *askpass_program;
43 const char *excludes_file;
44 enum auto_crlf auto_crlf = AUTO_CRLF_FALSE;
45 int read_replace_refs = 1;
46 -enum eol eol = EOL_UNSET;
46 +enum eol core_eol = EOL_UNSET;
47 enum safe_crlf safe_crlf = SAFE_CRLF_WARN;
48 unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
49 enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;