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>
This commit is contained in:

committed by
Junio C Hamano

parent
55e6b3547d
commit
36e7ed69de
@ -240,7 +240,7 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EDIT_TODO:
|
case EDIT_TODO:
|
||||||
ret = edit_todo_list(flags);
|
ret = edit_todo_list(the_repository, flags);
|
||||||
break;
|
break;
|
||||||
case SHOW_CURRENT_PATCH: {
|
case SHOW_CURRENT_PATCH: {
|
||||||
struct child_process cmd = CHILD_PROCESS_INIT;
|
struct child_process cmd = CHILD_PROCESS_INIT;
|
||||||
|
@ -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;
|
struct strbuf buf = STRBUF_INIT;
|
||||||
const char *todo_file = rebase_path_todo();
|
const char *todo_file = rebase_path_todo();
|
||||||
@ -69,7 +69,7 @@ int edit_todo_list(unsigned flags)
|
|||||||
|
|
||||||
strbuf_release(&buf);
|
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)
|
if (strbuf_read_file(&buf, todo_file, 0) < 0)
|
||||||
return error_errno(_("could not read '%s'."), todo_file);
|
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))
|
if (launch_sequence_editor(todo_file, NULL, NULL))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
transform_todos(the_repository, flags & ~(TODO_LIST_SHORTEN_IDS));
|
transform_todos(r, flags & ~(TODO_LIST_SHORTEN_IDS));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
#ifndef REBASE_INTERACTIVE_H
|
#ifndef REBASE_INTERACTIVE_H
|
||||||
#define REBASE_INTERACTIVE_H
|
#define REBASE_INTERACTIVE_H
|
||||||
|
|
||||||
|
struct strbuf;
|
||||||
|
struct repository;
|
||||||
|
|
||||||
void append_todo_help(unsigned edit_todo, unsigned keep_empty,
|
void append_todo_help(unsigned edit_todo, unsigned keep_empty,
|
||||||
struct strbuf *buf);
|
struct strbuf *buf);
|
||||||
int edit_todo_list(unsigned flags);
|
int edit_todo_list(struct repository *r, unsigned flags);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user