[ostree: 15/70] commit: support editor for orphan commits
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree: 15/70] commit: support editor for orphan commits
- Date: Fri, 15 Apr 2016 21:02:30 +0000 (UTC)
commit 9260d3dba1dc1d22a612161543e46ef22dce18fd
Author: Jonathan Lebon <jlebon redhat com>
Date: Tue Mar 29 23:27:19 2016 -0400
commit: support editor for orphan commits
This is a follow up to #227 to allow ostree to open the editor also for
orphan commits when no subject or body is given on the cmdline.
Closes: #229
Approved by: cgwalters
src/ostree/ot-builtin-commit.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/ostree/ot-builtin-commit.c b/src/ostree/ot-builtin-commit.c
index 2c74d4d..1d96855 100644
--- a/src/ostree/ot-builtin-commit.c
+++ b/src/ostree/ot-builtin-commit.c
@@ -194,9 +194,8 @@ commit_editor (OstreeRepo *repo,
input = g_strdup_printf ("\n"
"# Please enter the commit message for your changes. The first line will\n"
"# become the subject, and the remainder the body. Lines starting\n"
- "# with '#' will be ignored, and an empty message aborts the commit.\n"
- "#\n"
- "# Branch: %s\n", branch);
+ "# with '#' will be ignored, and an empty message aborts the commit."
+ "%s%s\n", branch ? "\n#\n# Branch: " : "", branch ?: "");
output = ot_editor_prompt (repo, input, cancellable, error);
if (output == NULL)
@@ -382,7 +381,7 @@ ostree_builtin_commit (int argc, char **argv, GCancellable *cancellable, GError
goto out;
}
- if (!opt_subject && !opt_body && !opt_orphan)
+ if (!opt_subject && !opt_body)
{
if (!commit_editor (repo, opt_branch, &opt_subject, &opt_body, cancellable, error))
goto out;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]