Skip to content

Commit 84cdeed

Browse files
committed
Merge branch 'jc/sequencer-stopped-sha-simplify'
Code simplification. * jc/sequencer-stopped-sha-simplify: sequencer: stop abbreviating stopped-sha file
2 parents 741f1f8 + 0512eab commit 84cdeed

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sequencer.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static GIT_PATH_FUNC(rebase_path_author_script, "rebase-merge/author-script")
120120
static GIT_PATH_FUNC(rebase_path_amend, "rebase-merge/amend")
121121
/*
122122
* When we stop at a given patch via the "edit" command, this file contains
123-
* the abbreviated commit name of the corresponding patch.
123+
* the commit object name of the corresponding patch.
124124
*/
125125
static GIT_PATH_FUNC(rebase_path_stopped_sha, "rebase-merge/stopped-sha")
126126
/*
@@ -3111,11 +3111,12 @@ static int make_patch(struct repository *r,
31113111
{
31123112
struct strbuf buf = STRBUF_INIT;
31133113
struct rev_info log_tree_opt;
3114-
const char *subject, *p;
3114+
const char *subject;
3115+
char hex[GIT_MAX_HEXSZ + 1];
31153116
int res = 0;
31163117

3117-
p = short_commit_name(commit);
3118-
if (write_message(p, strlen(p), rebase_path_stopped_sha(), 1) < 0)
3118+
oid_to_hex_r(hex, &commit->object.oid);
3119+
if (write_message(hex, strlen(hex), rebase_path_stopped_sha(), 1) < 0)
31193120
return -1;
31203121
res |= write_rebase_head(&commit->object.oid);
31213122

@@ -4527,7 +4528,7 @@ int sequencer_continue(struct repository *r, struct replay_opts *opts)
45274528

45284529
if (read_oneliner(&buf, rebase_path_stopped_sha(),
45294530
READ_ONELINER_SKIP_IF_EMPTY) &&
4530-
!get_oid_committish(buf.buf, &oid))
4531+
!get_oid_hex(buf.buf, &oid))
45314532
record_in_rewritten(&oid, peek_command(&todo_list, 0));
45324533
strbuf_release(&buf);
45334534
}

0 commit comments

Comments
 (0)