rebase-interactive.c: remove the_repository references
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>
Nguyễn Thái Ngọc Duy committed
Nov 10, 2018 at 06:49 UTC
36e7ed69de2c07a0214e79bde45714b92ac30ff2
3 files changed
+8
-5
builtin/rebase--interactive.c
+1
-1
@@ -240,7 +240,7 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
240
break;
241
}
242
case EDIT_TODO:
243
- ret = edit_todo_list(flags);
243
+ ret = edit_todo_list(the_repository, flags);
244
break;
245
case SHOW_CURRENT_PATCH: {
246
struct child_process cmd = CHILD_PROCESS_INIT;
rebase-interactive.c
+3
-3
@@ -53,7 +53,7 @@ void append_todo_help(unsigned edit_todo, unsigned keep_empty,
53
}
54
}
55
56
-int edit_todo_list(unsigned flags)
56
+int edit_todo_list(struct repository *r, unsigned flags)
57
{
58
struct strbuf buf = STRBUF_INIT;
59
const char *todo_file = rebase_path_todo();
@@ -69,7 +69,7 @@ int edit_todo_list(unsigned flags)
69
70
strbuf_release(&buf);
71
72
- transform_todos(the_repository, flags | TODO_LIST_SHORTEN_IDS);
72
+ transform_todos(r, flags | TODO_LIST_SHORTEN_IDS);
73
74
if (strbuf_read_file(&buf, todo_file, 0) < 0)
75
return error_errno(_("could not read '%s'."), todo_file);
@@ -85,7 +85,7 @@ int edit_todo_list(unsigned flags)
85
if (launch_sequence_editor(todo_file, NULL, NULL))
86
return -1;
87
88
- transform_todos(the_repository, flags & ~(TODO_LIST_SHORTEN_IDS));
88
+ transform_todos(r, flags & ~(TODO_LIST_SHORTEN_IDS));
89
90
return 0;
91
}
rebase-interactive.h
+4
-1
@@ -1,8 +1,11 @@
1
#ifndef REBASE_INTERACTIVE_H
2
#define REBASE_INTERACTIVE_H
3
4
+struct strbuf;
5
+struct repository;
6
+
7
void append_todo_help(unsigned edit_todo, unsigned keep_empty,
8
struct strbuf *buf);
6
-int edit_todo_list(unsigned flags);
9
+int edit_todo_list(struct repository *r, unsigned flags);
10
11
#endif