mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 11:40:06 +02:00
git: fix config location (#2027)
This commit is contained in:
@@ -129,3 +129,44 @@ index 1cccc3a..076f6fa 100644
|
||||
--
|
||||
2.14.2
|
||||
|
||||
|
||||
From 6cc7223d58b1fbb829d462e682ba32b7ebf91404 Mon Sep 17 00:00:00 2001
|
||||
From: sfanxiang <sfanxiang@gmail.com>
|
||||
Date: Mon, 1 Jan 2018 13:26:28 +0000
|
||||
Subject: builtin: config: use xdg_config even if it does not exist
|
||||
|
||||
|
||||
diff --git a/builtin/config.c b/builtin/config.c
|
||||
index d13daee..2342d34 100644
|
||||
--- a/builtin/config.c
|
||||
+++ b/builtin/config.c
|
||||
@@ -508,22 +508,11 @@ int cmd_config(int argc, const char **argv, const char *prefix)
|
||||
char *user_config = expand_user_path("~/.gitconfig", 0);
|
||||
char *xdg_config = xdg_config_home("config");
|
||||
|
||||
- if (!user_config)
|
||||
- /*
|
||||
- * It is unknown if HOME/.gitconfig exists, so
|
||||
- * we do not know if we should write to XDG
|
||||
- * location; error out even if XDG_CONFIG_HOME
|
||||
- * is set and points at a sane location.
|
||||
- */
|
||||
- die("$HOME not set");
|
||||
-
|
||||
- if (access_or_warn(user_config, R_OK, 0) &&
|
||||
- xdg_config && !access_or_warn(xdg_config, R_OK, 0)) {
|
||||
- given_config_source.file = xdg_config;
|
||||
- free(user_config);
|
||||
- } else {
|
||||
+ if (!xdg_config) {
|
||||
given_config_source.file = user_config;
|
||||
- free(xdg_config);
|
||||
+ } else {
|
||||
+ given_config_source.file = xdg_config;
|
||||
+ if (user_config) free(user_config);
|
||||
}
|
||||
}
|
||||
else if (use_system_config)
|
||||
--
|
||||
2.15.1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user