convert: rename the "eol" global variable to "core_eol"
authorJunio C Hamano <gitster@pobox.com>
Mon, 9 May 2011 19:52:12 +0000 (12:52 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 May 2011 21:58:52 +0000 (14:58 -0700)
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>
cache.h
config.c
convert.c
environment.c

diff --git a/cache.h b/cache.h
index 2b341166241c7be98fb1012871266ebb910e1226..4e9123b77bcc9eea114edf3db274e3e1a58f03e7 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -606,7 +606,7 @@ enum eol {
 #endif
 };
 
-extern enum eol eol;
+extern enum eol core_eol;
 
 enum branch_track {
        BRANCH_TRACK_UNSPECIFIED = -1,
index 5f9ec2894570d23f8b91327374a4d82dd46cbca3..671c8df2cc4a856b3b32d4ec047298f0e5547878 100644 (file)
--- a/config.c
+++ b/config.c
@@ -583,7 +583,7 @@ static int git_default_core_config(const char *var, const char *value)
 
        if (!strcmp(var, "core.autocrlf")) {
                if (value && !strcasecmp(value, "input")) {
-                       if (eol == EOL_CRLF)
+                       if (core_eol == EOL_CRLF)
                                return error("core.autocrlf=input conflicts with core.eol=crlf");
                        auto_crlf = AUTO_CRLF_INPUT;
                        return 0;
@@ -603,14 +603,14 @@ static int git_default_core_config(const char *var, const char *value)
 
        if (!strcmp(var, "core.eol")) {
                if (value && !strcasecmp(value, "lf"))
-                       eol = EOL_LF;
+                       core_eol = EOL_LF;
                else if (value && !strcasecmp(value, "crlf"))
-                       eol = EOL_CRLF;
+                       core_eol = EOL_CRLF;
                else if (value && !strcasecmp(value, "native"))
-                       eol = EOL_NATIVE;
+                       core_eol = EOL_NATIVE;
                else
-                       eol = EOL_UNSET;
-               if (eol == EOL_CRLF && auto_crlf == AUTO_CRLF_INPUT)
+                       core_eol = EOL_UNSET;
+               if (core_eol == EOL_CRLF && auto_crlf == AUTO_CRLF_INPUT)
                        return error("core.autocrlf=input conflicts with core.eol=crlf");
                return 0;
        }
index 7eb51b16ed03e650f3af11383c5c43c00d7d9812..4dba329e5048c4b33fc814bb946fff4b337d39f0 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -113,10 +113,10 @@ static enum eol determine_output_conversion(enum action action)
                        return EOL_CRLF;
                else if (auto_crlf == AUTO_CRLF_INPUT)
                        return EOL_LF;
-               else if (eol == EOL_UNSET)
+               else if (core_eol == EOL_UNSET)
                        return EOL_NATIVE;
        }
-       return eol;
+       return core_eol;
 }
 
 static void check_safe_crlf(const char *path, enum action action,
index 40185bc854ea2c5b8d2e3deb800dd6f3f44482a9..7fe9f101243d9063ff06fe2c6ea10f220b6a2549 100644 (file)
@@ -43,7 +43,7 @@ const char *askpass_program;
 const char *excludes_file;
 enum auto_crlf auto_crlf = AUTO_CRLF_FALSE;
 int read_replace_refs = 1;
-enum eol eol = EOL_UNSET;
+enum eol core_eol = EOL_UNSET;
 enum safe_crlf safe_crlf = SAFE_CRLF_WARN;
 unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
 enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;