]> git.ipfire.org Git - thirdparty/git.git/blobdiff - rebase-interactive.c
t7063: more thorough status checking
[thirdparty/git.git] / rebase-interactive.c
index aa18ae82b724812ea0b2939842395ac78f77bab1..1259adc8ea1afd51f062c18c972ef4acefeef496 100644 (file)
@@ -104,9 +104,11 @@ int edit_todo_list(struct repository *r, struct todo_list *todo_list,
                                    -1, flags | TODO_LIST_SHORTEN_IDS | TODO_LIST_APPEND_TODO_HELP))
                return error_errno(_("could not write '%s'"), todo_file);
 
-       if (initial && copy_file(rebase_path_todo_backup(), todo_file, 0666))
-               return error(_("could not copy '%s' to '%s'."), todo_file,
-                            rebase_path_todo_backup());
+       if (initial &&
+           todo_list_write_to_file(r, todo_list, rebase_path_todo_backup(),
+                                   shortrevisions, shortonto, -1,
+                                   (flags | TODO_LIST_APPEND_TODO_HELP) & ~TODO_LIST_SHORTEN_IDS) < 0)
+               return error(_("could not write '%s'."), rebase_path_todo_backup());
 
        if (launch_sequence_editor(todo_file, &new_todo->buf, NULL))
                return -2;