git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow usage of --gpg-sign flag in commit-tree builtin.
@ 2019-01-17 19:29 Brandon Richardson
  2019-01-17 20:24 ` Martin Ågren
  0 siblings, 1 reply; 2+ messages in thread
From: Brandon Richardson @ 2019-01-17 19:29 UTC (permalink / raw)
  To: git; +Cc: Brandon Richardson

Signed-off-by: Brandon Richardson <brandon1024.br@gmail.com>
---
Hi,

This is my first contribution, so please bear with me. All feedback
is appreciated.

Ran into this issue while writing a signed commit object manually.
Here are the steps I followed to replicate the issue:

mkdir test && cd test
git init
echo 'test' > test.txt
git hash-object -w test.txt
git update-index --add --cacheinfo 100644 <blob hash> test.txt
git write-tree
git commit-tree --gpg-sign -m 'test commit msg' <tree obj hash>

Thanks,
Brandon

 builtin/commit-tree.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index 9ec36a82b..9a06594f6 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -66,7 +66,9 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
 			continue;
 		}
 
-		if (skip_prefix(arg, "-S", &sign_commit))
+		if (skip_prefix(arg, "-S", &sign_commit) ||
+			skip_prefix(arg, "--gpg-sign=", &sign_commit) ||
+			skip_prefix(arg, "--gpg-sign", &sign_commit))
 			continue;
 
 		if (!strcmp(arg, "--no-gpg-sign")) {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-17 20:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-17 19:29 [PATCH] Allow usage of --gpg-sign flag in commit-tree builtin Brandon Richardson
2019-01-17 20:24 ` Martin Ågren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).