Code

Fix executable bits in t/ scripts
[git.git] / config.c
index 5431e2dc01b01b60de6e1392e242c9b0e5d2a8cf..c2f2bbb000cd003002c1bd346e6be6c9d3ef5c2d 100644 (file)
--- a/config.c
+++ b/config.c
@@ -448,6 +448,8 @@ int git_default_config(const char *var, const char *value, void *dummy)
                if (!value)
                        return config_error_nonbool(var);
                strlcpy(git_default_name, value, sizeof(git_default_name));
+               if (git_default_email[0])
+                       user_ident_explicitly_given = 1;
                return 0;
        }
 
@@ -455,6 +457,8 @@ int git_default_config(const char *var, const char *value, void *dummy)
                if (!value)
                        return config_error_nonbool(var);
                strlcpy(git_default_email, value, sizeof(git_default_email));
+               if (git_default_name[0])
+                       user_ident_explicitly_given = 1;
                return 0;
        }
 
@@ -699,7 +703,7 @@ static int store_write_section(int fd, const char* key)
        if (dot) {
                strbuf_addf(&sb, "[%.*s \"", (int)(dot - key), key);
                for (i = dot - key + 1; i < store.baselen; i++) {
-                       if (key[i] == '"')
+                       if (key[i] == '"' || key[i] == '\\')
                                strbuf_addch(&sb, '\\');
                        strbuf_addch(&sb, key[i]);
                }