Skip to content

Commit 36e7ed6

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 55e6b35 commit 36e7ed6

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

builtin/rebase--interactive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
240240
break;
241241
}
242242
case EDIT_TODO:
243-
ret = edit_todo_list(flags);
243+
ret = edit_todo_list(the_repository, flags);
244244
break;
245245
case SHOW_CURRENT_PATCH: {
246246
struct child_process cmd = CHILD_PROCESS_INIT;

rebase-interactive.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void append_todo_help(unsigned edit_todo, unsigned keep_empty,
5353
}
5454
}
5555

56-
int edit_todo_list(unsigned flags)
56+
int edit_todo_list(struct repository *r, unsigned flags)
5757
{
5858
struct strbuf buf = STRBUF_INIT;
5959
const char *todo_file = rebase_path_todo();
@@ -69,7 +69,7 @@ int edit_todo_list(unsigned flags)
6969

7070
strbuf_release(&buf);
7171

72-
transform_todos(the_repository, flags | TODO_LIST_SHORTEN_IDS);
72+
transform_todos(r, flags | TODO_LIST_SHORTEN_IDS);
7373

7474
if (strbuf_read_file(&buf, todo_file, 0) < 0)
7575
return error_errno(_("could not read '%s'."), todo_file);
@@ -85,7 +85,7 @@ int edit_todo_list(unsigned flags)
8585
if (launch_sequence_editor(todo_file, NULL, NULL))
8686
return -1;
8787

88-
transform_todos(the_repository, flags & ~(TODO_LIST_SHORTEN_IDS));
88+
transform_todos(r, flags & ~(TODO_LIST_SHORTEN_IDS));
8989

9090
return 0;
9191
}

rebase-interactive.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#ifndef REBASE_INTERACTIVE_H
22
#define REBASE_INTERACTIVE_H
33

4+
struct strbuf;
5+
struct repository;
6+
47
void append_todo_help(unsigned edit_todo, unsigned keep_empty,
58
struct strbuf *buf);
6-
int edit_todo_list(unsigned flags);
9+
int edit_todo_list(struct repository *r, unsigned flags);
710

811
#endif

0 commit comments

Comments
 (0)