summaryrefslogtreecommitdiff
blob: b5e3af10680499e7f850a5c78523b3f466f6df33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From: Renee Margaret McConahy <nepella@gmail.com>
Subject: [PATCH v2] am: configure gpg at startup
Newsgroups: gmane.comp.version-control.git
Date: 2015-09-30 17:49:44 GMT (5 days, 14 hours and 45 minutes ago)
The new builtin am ignores the user.signingkey variable: gpg is being
called with the committer details as the key ID, which may not be
correct. git_gpg_config is responsible for handling that variable and is
expected to be called on initialization by any modules that use gpg.

Perhaps git_gpg_config's functionality ought to be merged into
git_default_config, but this is simpler and in keeping with the current
practice.

Signed-off-by: Renee Margaret McConahy <nepella@gmail.com>
---

 builtin/am.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/builtin/am.c b/builtin/am.c
index 4f77e07..3bd4fd7 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2208,6 +2208,17 @@ enum resume_mode {
 	RESUME_ABORT
 };

+static int git_am_config(const char *k, const char *v, void *cb)
+{
+	int status;
+
+	status = git_gpg_config(k, v, NULL);
+	if (status)
+		return status;
+
+	return git_default_config(k, v, NULL);
+}
+
 int cmd_am(int argc, const char **argv, const char *prefix)
 {
 	struct am_state state;
@@ -2308,7 +2319,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
 		OPT_END()
 	};

-	git_config(git_default_config, NULL);
+	git_config(git_am_config, NULL);

 	am_state_init(&state, git_path("rebase-apply"));

-- 
2.5.3