Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-09-25 08:49:12 +0300
committerJunio C Hamano <gitster@pobox.com>2020-09-26 00:11:12 +0300
commit0512eabd915a6a7e79b368bf6408b36bbdc56386 (patch)
treeaf3d1cf4b5a552de14c8ce97e71b5a80c0eb6c0e /sequencer.c
parent47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc (diff)
sequencer: stop abbreviating stopped-sha file
The object name written to this file is not exposed to end-users and the only reader of this file immediately expands it back to a full object name. Stop abbreviating while writing, and expect a full object name while reading, which simplifies the code a bit. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sequencer.c b/sequencer.c
index fd7701c88a..7dc9088d09 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -120,7 +120,7 @@ static GIT_PATH_FUNC(rebase_path_author_script, "rebase-merge/author-script")
static GIT_PATH_FUNC(rebase_path_amend, "rebase-merge/amend")
/*
* When we stop at a given patch via the "edit" command, this file contains
- * the abbreviated commit name of the corresponding patch.
+ * the commit object name of the corresponding patch.
*/
static GIT_PATH_FUNC(rebase_path_stopped_sha, "rebase-merge/stopped-sha")
/*
@@ -3012,11 +3012,12 @@ static int make_patch(struct repository *r,
{
struct strbuf buf = STRBUF_INIT;
struct rev_info log_tree_opt;
- const char *subject, *p;
+ const char *subject;
+ char hex[GIT_MAX_HEXSZ + 1];
int res = 0;
- p = short_commit_name(commit);
- if (write_message(p, strlen(p), rebase_path_stopped_sha(), 1) < 0)
+ oid_to_hex_r(hex, &commit->object.oid);
+ if (write_message(hex, strlen(hex), rebase_path_stopped_sha(), 1) < 0)
return -1;
res |= write_rebase_head(&commit->object.oid);
@@ -4396,7 +4397,7 @@ int sequencer_continue(struct repository *r, struct replay_opts *opts)
if (read_oneliner(&buf, rebase_path_stopped_sha(),
READ_ONELINER_SKIP_IF_EMPTY) &&
- !get_oid_committish(buf.buf, &oid))
+ !get_oid_hex(buf.buf, &oid))
record_in_rewritten(&oid, peek_command(&todo_list, 0));
strbuf_release(&buf);
}