Skip to content

Conversation

@bierbaum
Copy link
Contributor

As builtin extensions are evaluated in the latter half of check_valid_extension, a string cfg is concatenated with the static string 'extension.' and the value from builtin_extension, before being compared with the configured value. This string is not being cleared while iterating through the names of the extensions. Because there is currently only one extension (noop), the bug was never noticeable.

This patch corrects the behavior by clearing the string on each iteration, as is done in for user extensions in the preceding block.

…ation

As builtin extensions are evaluated in the latter half of `check_valid_extension`, a string `cfg` is concatenated with the static string 'extension.' and the value from `builtin_extension`, before being compared with the configured value. This string is not being cleared while iterating through the names of the extensions. Because there is currently only one extension ('noop'), the bug was never noticible.

This patch corrects the behavior by clearing the string on each iteration, as is done in the first block.
@bierbaum
Copy link
Contributor Author

I noticed this while testing the following patch: https://github.com/vermiculus/libgit2/tree/sallred/support-worktree-config

@ethomson
Copy link
Member

Oops, good catch. Thanks!

@ethomson ethomson merged commit 0e53006 into libgit2:main Mar 23, 2022
@ethomson ethomson added the bug label Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants