git: fix config directory patch

some tests depend on awk
This commit is contained in:
Jerome Duval
2021-01-05 18:22:15 +01:00
parent 10b06b2ff6
commit 6d8b3756ea
2 changed files with 36 additions and 40 deletions

View File

@@ -1,4 +1,4 @@
From 1c74acedb8f0c4682a3e889cf23b43cde4b5f5a3 Mon Sep 17 00:00:00 2001
From f1fc231c2e257a644cacd9a9f6311ea59b8f178d Mon Sep 17 00:00:00 2001
From: Ingo Weinhold <ingo_weinhold@gmx.de>
Date: Tue, 13 Aug 2013 08:07:25 +0200
Subject: git-web--browse.sh: use "open" on Haiku
@@ -21,10 +21,10 @@ index ae15253..b074d1a 100755
init_browser_path $i
if type "$browser_path" > /dev/null 2>&1; then
--
2.28.0
2.30.0
From aa131000e2bb5119015c0cdabeb026c03de8e659 Mon Sep 17 00:00:00 2001
From bfb2c3b810c8235348c02afb82dbd8253058270d Mon Sep 17 00:00:00 2001
From: Ingo Weinhold <ingo_weinhold@gmx.de>
Date: Mon, 19 Jan 2015 15:37:16 -0500
Subject: On Haiku use the user settings directory instead of HOME
@@ -67,45 +67,39 @@ index 7b385e5..f0669d6 100644
home = getenv("HOME");
if (home)
--
2.28.0
2.30.0
From b9658a023ab00baaabde5fb9a6eba55293b0a34b Mon Sep 17 00:00:00 2001
From 1a25c7c85ac35a748b8bccb64862f2c0c88f92e5 Mon Sep 17 00:00:00 2001
From: Oliver Tappe <zooey@hirschkaefer.de>
Date: Mon, 19 Jan 2015 15:50:09 -0500
Subject: Ensure config-directory exists before using it.
diff --git a/config.c b/config.c
index 1137bd7..6dd4b41 100644
index 1137bd7..14cd935 100644
--- a/config.c
+++ b/config.c
@@ -2761,6 +2761,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
int ret;
struct lock_file lock = LOCK_INIT;
char *filename_buf = NULL;
+ char *config_dir = NULL;
char *contents = NULL;
size_t contents_sz;
struct config_store_data store;
@@ -2777,6 +2778,12 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
@@ -2777,6 +2777,14 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
if (!config_filename)
config_filename = filename_buf = git_pathdup("config");
+ config_dir = xstrdup(config_filename);
+ * find_last_dir_sep(config_dir) = '\0';
+ if (access(config_dir, F_OK) != 0)
+ mkdir(config_dir, 0755);
+ free(config_dir);
+ if (find_last_dir_sep(config_filename) != NULL) {
+ char *config_dir = xstrdup(config_filename);
+ * find_last_dir_sep(config_dir) = '\0';
+ if (access(config_dir, F_OK) != 0)
+ mkdir(config_dir, 0755);
+ free(config_dir);
+ }
+
/*
* The lock serves a purpose in addition to locking: the new
* contents of .git/config will be written into it.
--
2.28.0
2.30.0
From 2af7a649faab7562fee5cd32de2a4e8e522b5c1b Mon Sep 17 00:00:00 2001
From b4d5770706a101133ca8b32350c39e8bd3c133e6 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 14 Feb 2016 10:32:12 +0100
Subject: Move credential cache to the config directory.
@@ -126,10 +120,10 @@ index 9b3f709..893db81 100644
socket = xstrfmt("%s/socket", old_dir);
else
--
2.28.0
2.30.0
From 0663035df5770c9cb2edc3c6f7578bfc38e5ef49 Mon Sep 17 00:00:00 2001
From 9460278c9eeefb9400ed24b214da394e7310eb51 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
@@ -169,10 +163,10 @@ index f71fa39..0843a19 100644
}
else if (use_system_config) {
--
2.28.0
2.30.0
From 68029054d6d00db50c422d37284246908a493e26 Mon Sep 17 00:00:00 2001
From b8d68d0d6336135fdc4c37351c369b4c5c90197c Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 18 Nov 2018 11:56:26 +0100
Subject: Fix detection of Haiku for git web browse
@@ -196,10 +190,10 @@ index b074d1a..0f95000 100755
fi
--
2.28.0
2.30.0
From 97dfbc1daa64c44975dc8617eacdf5a7688dcbc6 Mon Sep 17 00:00:00 2001
From 3e184bad49786c265d2826bb5c34986ed2f2e483 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 29 Nov 2019 21:46:54 +0100
Subject: ignore test failures.
@@ -219,5 +213,5 @@ index 882d26e..3252f7f 100644
pre-clean:
$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
--
2.28.0
2.30.0