rebase-interactive.c: remove the_repository references
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 10 Nov 2018 05:49:10 +0000 (06:49 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Nov 2018 05:50:06 +0000 (14:50 +0900)
While at there add a forward declaration for struct strbuf.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase--interactive.c
rebase-interactive.c
rebase-interactive.h
index bd7d39e2af9c335486d2c88adfe462df9caf1c66..dd2a55ab1d956ef0937cfdb0e4e3fb026ac2ff81 100644 (file)
@@ -240,7 +240,7 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
                break;
        }
        case EDIT_TODO:
-               ret = edit_todo_list(flags);
+               ret = edit_todo_list(the_repository, flags);
                break;
        case SHOW_CURRENT_PATCH: {
                struct child_process cmd = CHILD_PROCESS_INIT;
index 3cc19283ff11e7ce533e553188e2fb65a25ef9a3..68aff1dac28878f2f9c010459bf5f4362322bd3f 100644 (file)
@@ -53,7 +53,7 @@ void append_todo_help(unsigned edit_todo, unsigned keep_empty,
        }
 }
 
-int edit_todo_list(unsigned flags)
+int edit_todo_list(struct repository *r, unsigned flags)
 {
        struct strbuf buf = STRBUF_INIT;
        const char *todo_file = rebase_path_todo();
@@ -69,7 +69,7 @@ int edit_todo_list(unsigned flags)
 
        strbuf_release(&buf);
 
-       transform_todos(the_repository, flags | TODO_LIST_SHORTEN_IDS);
+       transform_todos(r, flags | TODO_LIST_SHORTEN_IDS);
 
        if (strbuf_read_file(&buf, todo_file, 0) < 0)
                return error_errno(_("could not read '%s'."), todo_file);
@@ -85,7 +85,7 @@ int edit_todo_list(unsigned flags)
        if (launch_sequence_editor(todo_file, NULL, NULL))
                return -1;
 
-       transform_todos(the_repository, flags & ~(TODO_LIST_SHORTEN_IDS));
+       transform_todos(r, flags & ~(TODO_LIST_SHORTEN_IDS));
 
        return 0;
 }
index 971da037769476da196ae39eec89431be4923d54..17b6c9f6d05ea2372c58a50679cb0f8fb808aaef 100644 (file)
@@ -1,8 +1,11 @@
 #ifndef REBASE_INTERACTIVE_H
 #define REBASE_INTERACTIVE_H
 
+struct strbuf;
+struct repository;
+
 void append_todo_help(unsigned edit_todo, unsigned keep_empty,
                      struct strbuf *buf);
-int edit_todo_list(unsigned flags);
+int edit_todo_list(struct repository *r, unsigned flags);
 
 #endif