commit-tree: add missing --gpg-sign flag

Add --gpg-sign option in commit-tree, which was documented, but not
implemented, in 55ca3f99ae. Add tests for the --gpg-sign option.

Signed-off-by: Brandon Richardson <brandon1024.br@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brandon Richardson
2019-01-19 19:23:34 -04:00
committed by Junio C Hamano
parent 41a74bd013
commit 70ddbd7767
2 changed files with 19 additions and 4 deletions

View File

@ -66,7 +66,13 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
continue;
}
if (skip_prefix(arg, "-S", &sign_commit))
if (!strcmp(arg, "--gpg-sign")) {
sign_commit = "";
continue;
}
if (skip_prefix(arg, "-S", &sign_commit) ||
skip_prefix(arg, "--gpg-sign=", &sign_commit))
continue;
if (!strcmp(arg, "--no-gpg-sign")) {