[gitg/wip/albfan/body-patch: 2/3] Add body to patch



commit 8003bc816f30597e11564301d35df8517dbdb88a
Author: Alberto Fanjul <albertofanjul gmail com>
Date:   Tue Jan 1 20:20:58 2019 +0100

    Add body to patch

 gitg/gitg-commit-action-create-patch.vala | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gitg/gitg-commit-action-create-patch.vala b/gitg/gitg-commit-action-create-patch.vala
index d31bc5f9..5621531d 100644
--- a/gitg/gitg-commit-action-create-patch.vala
+++ b/gitg/gitg-commit-action-create-patch.vala
@@ -127,7 +127,11 @@ class CommitActionCreatePatch : GitgExt.UIElement, GitgExt.Action, GitgExt.Commi
 
                var opts = new Ggit.DiffFormatEmailOptions();
 
-               opts.summary = commit.get_message();
+               var message = commit.get_message();
+               opts.summary = message;
+               var pos = message.index_of_char('\n');
+               if (pos != -1 && pos + 1 != message.length)
+                       opts.body = message.substring(pos + 2, message.length - (pos + 2));
                opts.patch_number = 1;
                opts.total_patches = 1;
                opts.id = commit.get_id();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]