Skip to content

Commit 434c64d

Browse files
nepellagitster
authored andcommitted
am: configure gpg at startup
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. Signed-off-by: Renee Margaret McConahy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1fb5a0e commit 434c64d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

builtin/am.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,6 +2125,17 @@ enum resume_mode {
21252125
RESUME_ABORT
21262126
};
21272127

2128+
static int git_am_config(const char *k, const char *v, void *cb)
2129+
{
2130+
int status;
2131+
2132+
status = git_gpg_config(k, v, NULL);
2133+
if (status)
2134+
return status;
2135+
2136+
return git_default_config(k, v, NULL);
2137+
}
2138+
21282139
int cmd_am(int argc, const char **argv, const char *prefix)
21292140
{
21302141
struct am_state state;
@@ -2223,7 +2234,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
22232234
OPT_END()
22242235
};
22252236

2226-
git_config(git_default_config, NULL);
2237+
git_config(git_am_config, NULL);
22272238

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

0 commit comments

Comments
 (0)