[RFC/PATCH 17/18] revert: add remaining instructions in todo file

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

 



Signed-off-by: Christian Couder <chriscool@xxxxxxxxxxxxx>
---
 builtin/revert.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index ca65b92..b51f7ab 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -483,14 +483,19 @@ static void get_todo_content(struct strbuf *buf, struct commit_list *list,
 }
 
 static void create_todo_file(const char *filepath, int append,
-			     struct commit_list *list, const char *line_prefix,
-			     struct args_info *info)
+			     struct commit_list *list, struct parsed_insn *insn,
+			     const char *line_prefix, struct args_info *info)
 {
 	int fd, flags;
 	struct strbuf buf = STRBUF_INIT;
 
 	get_todo_content(&buf, list, line_prefix, info);
 
+	if (insn) {
+		while ((insn = insn->next))
+			strbuf_addbuf(&buf, &insn->orig);
+	}
+
 	flags = O_WRONLY | O_CREAT | (append ? O_APPEND : O_TRUNC);
 	fd = open(filepath, flags, 0666);
 	if (fd < 0)
@@ -926,9 +931,9 @@ static int save_todo_and_done(int res, struct args_info *infos,
 				  SEQ_PATH);
 		if (commit)
 			commit_list_insert(commit, &todo_list);
-		create_todo_file(TODO_FILE, 0, todo_list, "", infos);
+		create_todo_file(TODO_FILE, 0, todo_list, NULL, "", infos);
 		*done_list = reverse_commit_list(*done_list);
-		create_todo_file(DONE_FILE, 0, *done_list, "", infos);
+		create_todo_file(DONE_FILE, 0, *done_list, NULL, "", infos);
 	}
 	return res;
 }
-- 
1.7.3.2.504.g59d466


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]