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:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-10-23 01:15:03 +0300
committerJunio C Hamano <gitster@pobox.com>2018-10-23 07:17:08 +0300
commit12aeb00a22e589f85e26da833e05bb1a7e412d07 (patch)
tree328214da4651d140957cca8673c432a3088569dd /builtin
parent71064e6008d13de72de0387a1301a557477cbed2 (diff)
rebase (autostash): store the full OID in <state-dir>/autostash
It was reported by Gábor Szeder and analyzed by Alban Gruin that the built-in rebase stores only abbreviated stash hashes in the `autostash` file. This is problematic e.g. in t5520-pull.sh, where the abbreviated hash is so short that it sometimes consists only of digits, which are subsequently mistaken ("DWIMmed") for numbers by `git stash apply`. Let's align the behavior of the built-in rebase with the scripted rebase and store the full stash hash instead. That makes it a lot less likely that it consists only of digits. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rebase.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 42f320453a..cd6beb96b4 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1374,7 +1374,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (safe_create_leading_directories_const(autostash))
die(_("Could not create directory for '%s'"),
options.state_dir);
- write_file(autostash, "%s", buf.buf);
+ write_file(autostash, "%s", oid_to_hex(&oid));
printf(_("Created autostash: %s\n"), buf.buf);
if (reset_head(&head->object.oid, "reset --hard",
NULL, 0, NULL, NULL) < 0)