diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2022-11-09 14:21:57 +0000 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2022-11-09 18:15:43 -0500 |
commit | d188a60d7228f051bb4004924d20d961ada636f3 (patch) | |
tree | 95bef8b80afea30c009330d5f1699faea03c5ef1 /sequencer.h | |
parent | 3b08839926fcc7cc48cf4c759737c1a71af430c1 (diff) | |
download | git-d188a60d7228f051bb4004924d20d961ada636f3.tar.gz |
sequencer: stop exporting GIT_REFLOG_ACTION
Each time it picks a commit the sequencer copies the GIT_REFLOG_ACITON
environment variable so it can temporarily change it and then restore
the previous value. This results in code that is hard to follow and also
leaks memory because (i) we fail to free the copy when we've finished
with it and (ii) each call to setenv() leaks the previous value. Instead
pass the reflog action around in a variable and use it to set
GIT_REFLOG_ACTION in the child environment when running "git commit".
Within the sequencer GIT_REFLOG_ACTION is no longer set and is only read
by sequencer_reflog_action(). It is still set by rebase before calling
the sequencer, that will be addressed in the next commit. cherry-pick
and revert are unaffected as they do not set GIT_REFLOG_ACTION before
calling the sequencer.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'sequencer.h')
-rw-r--r-- | sequencer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sequencer.h b/sequencer.h index 563fe59933..888c18aad7 100644 --- a/sequencer.h +++ b/sequencer.h @@ -63,6 +63,9 @@ struct replay_opts { char **xopts; size_t xopts_nr, xopts_alloc; + /* Reflog */ + char *reflog_action; + /* Used by fixup/squash */ struct strbuf current_fixups; int current_fixup_count; @@ -73,6 +76,9 @@ struct replay_opts { /* Only used by REPLAY_NONE */ struct rev_info *revs; + + /* Private use */ + const char *reflog_message; }; #define REPLAY_OPTS_INIT { .edit = -1, .action = -1, .current_fixups = STRBUF_INIT } |