sequencer: tolerate abbreviated stopped-sha file
authorJonathan Tan <redacted>
Wed, 21 Oct 2020 22:03:53 +0000 (15:03 -0700)
committerJunio C Hamano <redacted>
Thu, 22 Oct 2020 06:04:16 +0000 (23:04 -0700)
In 0512eabd91 ("sequencer: stop abbreviating stopped-sha file",
2020-09-25), Git was taught both to write full object names to the
stopped-sha file and to require full object names when reading. However,
a user would experience a problem if they started an interactive rebase
using an old version of Git and then continued with a current version of
Git (for example, if the system version of Git was updated in the
meantime).

Teach Git to allow object names of any length when reading.

Signed-off-by: Jonathan Tan <redacted>
Signed-off-by: Junio C Hamano <redacted>
sequencer.c

index 7dc9088d09077a5986b1733bae33a2d366a6c35e..43b06d8950e70214c202413e964ae579b18bb86d 100644 (file)
@@ -2552,7 +2552,7 @@ static int read_populate_opts(struct replay_opts *opts)
                }
 
                if (read_oneliner(&buf, rebase_path_squash_onto(), 0)) {
-                       if (get_oid_hex(buf.buf, &opts->squash_onto) < 0) {
+                       if (get_oid_committish(buf.buf, &opts->squash_onto) < 0) {
                                ret = error(_("unusable squash-onto"));
                                goto done_rebase_i;
                        }
git clone https://git.99rst.org/PROJECT