-
Notifications
You must be signed in to change notification settings - Fork 165
Re-fix rebase -i with SHA-1 collisions
#529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2118,18 +2118,19 @@ static int parse_insn_line(struct repository *r, struct todo_item *item, | |
| saved = *end_of_object_name; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Johannes Schindelin wrote (reply to this): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Eric Sunshine wrote (reply to this): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Johannes Schindelin wrote (reply to this): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Eric Sunshine wrote (reply to this): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Johannes Schindelin wrote (reply to this): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Johannes Schindelin wrote (reply to this): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Johannes Schindelin wrote (reply to this): |
||
| *end_of_object_name = '\0'; | ||
| status = get_oid(bol, &commit_oid); | ||
| if (status < 0) | ||
| error(_("could not parse '%s'"), bol); /* return later */ | ||
| *end_of_object_name = saved; | ||
|
|
||
| bol = end_of_object_name + strspn(end_of_object_name, " \t"); | ||
| item->arg_offset = bol - buf; | ||
| item->arg_len = (int)(eol - bol); | ||
|
|
||
| if (status < 0) | ||
| return error(_("could not parse '%.*s'"), | ||
| (int)(end_of_object_name - bol), bol); | ||
| return status; | ||
|
|
||
| item->commit = lookup_commit_reference(r, &commit_oid); | ||
| return !item->commit; | ||
| return item->commit ? 0 : -1; | ||
| } | ||
|
|
||
| int sequencer_get_last_command(struct repository *r, enum replay_action *action) | ||
|
|
@@ -5075,7 +5076,7 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla | |
| { | ||
| const char *shortonto, *todo_file = rebase_path_todo(); | ||
| struct todo_list new_todo = TODO_LIST_INIT; | ||
| struct strbuf *buf = &todo_list->buf; | ||
| struct strbuf *buf = &todo_list->buf, buf2 = STRBUF_INIT; | ||
| struct object_id oid = onto->object.oid; | ||
| int res; | ||
|
|
||
|
|
@@ -5127,6 +5128,15 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla | |
| return -1; | ||
| } | ||
|
|
||
| /* Expand the commit IDs */ | ||
| todo_list_to_strbuf(r, &new_todo, &buf2, -1, 0); | ||
| strbuf_swap(&new_todo.buf, &buf2); | ||
| strbuf_release(&buf2); | ||
| new_todo.total_nr -= new_todo.nr; | ||
| if (todo_list_parse_insn_buffer(r, new_todo.buf.buf, &new_todo) < 0) | ||
| BUG("invalid todo list after expanding IDs:\n%s", | ||
| new_todo.buf.buf); | ||
|
|
||
| if (opts->allow_ff && skip_unnecessary_picks(r, &new_todo, &oid)) { | ||
| todo_list_release(&new_todo); | ||
| return error(_("could not skip unnecessary pick commands")); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Junio C Hamano wrote (reply to this):