Commit 082f71f
fixup! Add config option
We need to be very careful _not_ to read the config too early. The
reason is that some Git commands want to delay reading the config until
they configured something beforehand.
For example, `cmd_commit()` sets the `warn_on_auto_comment_char = true`
before reading the config, implicitly telling the function
`check_auto_comment_char_config()` to warn (once) when encountering the
corresponding, deprecated construct.
If `mingw_open()` reads the config already at the point when the gitdir
is discovered, i.e. way before `cmd_commit()` can do its thing, that
global flag will still be `false` when the warning should be produced.
Earlier, we already had to fiddle with the condition, to ensure that the
commondir is already initialized (and therefore it should be safe to
read the config). That was still not enough, apparently.
The symptom is that both t3404.86 (rebase -i respects
core.commentchar=auto) and t7502.85 (core.commentChar=auto is rejected)
will fail.
The good news is that the config setting we want to read in
`mingw_open()` concerns itself with _appending to files_, something we
will never do before reaching `cmd_commit()`. Therefore, simply
extending the guard around config reading makes this logic "delayed
enough" so that aforementioned test cases pass successfully.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>windows.appendAtomically
1 parent fdf27fc commit 082f71f
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
942 | 942 | | |
943 | 943 | | |
944 | 944 | | |
945 | | - | |
| 945 | + | |
946 | 946 | | |
947 | 947 | | |
948 | 948 | | |
| |||
0 commit comments