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



commit 730660e56e7a2e0eaa44a35a476ed84ebd34fdc6
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]