Skip to content

Commit ec70f52

Browse files
committed
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 <[email protected]>
1 parent 4e3aa87 commit ec70f52

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ enum eol {
606606
#endif
607607
};
608608

609-
extern enum eol eol;
609+
extern enum eol core_eol;
610610

611611
enum branch_track {
612612
BRANCH_TRACK_UNSPECIFIED = -1,

config.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ static int git_default_core_config(const char *var, const char *value)
583583

584584
if (!strcmp(var, "core.autocrlf")) {
585585
if (value && !strcasecmp(value, "input")) {
586-
if (eol == EOL_CRLF)
586+
if (core_eol == EOL_CRLF)
587587
return error("core.autocrlf=input conflicts with core.eol=crlf");
588588
auto_crlf = AUTO_CRLF_INPUT;
589589
return 0;
@@ -603,14 +603,14 @@ static int git_default_core_config(const char *var, const char *value)
603603

604604
if (!strcmp(var, "core.eol")) {
605605
if (value && !strcasecmp(value, "lf"))
606-
eol = EOL_LF;
606+
core_eol = EOL_LF;
607607
else if (value && !strcasecmp(value, "crlf"))
608-
eol = EOL_CRLF;
608+
core_eol = EOL_CRLF;
609609
else if (value && !strcasecmp(value, "native"))
610-
eol = EOL_NATIVE;
610+
core_eol = EOL_NATIVE;
611611
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)
614614
return error("core.autocrlf=input conflicts with core.eol=crlf");
615615
return 0;
616616
}

convert.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ static enum eol determine_output_conversion(enum action action)
113113
return EOL_CRLF;
114114
else if (auto_crlf == AUTO_CRLF_INPUT)
115115
return EOL_LF;
116-
else if (eol == EOL_UNSET)
116+
else if (core_eol == EOL_UNSET)
117117
return EOL_NATIVE;
118118
}
119-
return eol;
119+
return core_eol;
120120
}
121121

122122
static void check_safe_crlf(const char *path, enum action action,

environment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const char *askpass_program;
4343
const char *excludes_file;
4444
enum auto_crlf auto_crlf = AUTO_CRLF_FALSE;
4545
int read_replace_refs = 1;
46-
enum eol eol = EOL_UNSET;
46+
enum eol core_eol = EOL_UNSET;
4747
enum safe_crlf safe_crlf = SAFE_CRLF_WARN;
4848
unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
4949
enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;

0 commit comments

Comments
 (0)