diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-12-26 11:42:04 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-12-26 11:42:04 +0900 |
| commit | 4a9b839dd1166b3f205ff77e9f3ebdedb045ccba (patch) | |
| tree | e90793828e50c98d238efe3c61da01e595674532 | |
| parent | 7c2ef319c52c4997256f5807564523dfd4acdfc7 (diff) | |
| parent | 0918d0888767d42a7232b110f5ec510945256b7e (diff) | |
| download | git-4a9b839dd1166b3f205ff77e9f3ebdedb045ccba.tar.xz | |
Merge branch 'sg/help-autocorrect-config-fix'
The code to auto-correct a misspelt subcommand unnecessarily called
into git_default_config() from the early config codepath, which was
a no-no. This has bee corrected.
* sg/help-autocorrect-config-fix:
help.c: fix autocorrect in work tree for bare repository
| -rw-r--r-- | help.c | 2 | ||||
| -rwxr-xr-x | t/t9003-help-autocorrect.sh | 6 |
2 files changed, 7 insertions, 1 deletions
@@ -563,7 +563,7 @@ static int git_unknown_cmd_config(const char *var, const char *value, void *cb) if (skip_prefix(var, "alias.", &p)) add_cmdname(&aliases, p, strlen(p)); - return git_default_config(var, value, cb); + return 0; } static int levenshtein_compare(const void *p1, const void *p2) diff --git a/t/t9003-help-autocorrect.sh b/t/t9003-help-autocorrect.sh index 4b9cb4c942..14a704d0a8 100755 --- a/t/t9003-help-autocorrect.sh +++ b/t/t9003-help-autocorrect.sh @@ -62,4 +62,10 @@ test_expect_success 'autocorrect can be declined altogether' ' test_line_count = 1 actual ' +test_expect_success 'autocorrect works in work tree created from bare repo' ' + git clone --bare . bare.git && + git -C bare.git worktree add ../worktree && + git -C worktree -c help.autocorrect=immediate stauts +' + test_done |
