Skip to content

Commit

Permalink
am: configure gpg at startup
Browse files Browse the repository at this point in the history
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 <nepella@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Renee Margaret McConahy authored and Junio C Hamano committed Sep 30, 2015
1 parent 1fb5a0e commit 434c64d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion builtin/am.c
Original file line number Diff line number Diff line change
Expand Up @@ -2125,6 +2125,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;
Expand Down Expand Up @@ -2223,7 +2234,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"));

Expand Down

0 comments on commit 434c64d

Please sign in to comment.