Skip to content

fix: prevent duplicate include entries in SSH config#339

Open
hakhandelwal11 wants to merge 1 commit intomainfrom
BREV-3127/fix/ssh-include-dup
Open

fix: prevent duplicate include entries in SSH config#339
hakhandelwal11 wants to merge 1 commit intomainfrom
BREV-3127/fix/ssh-include-dup

Conversation

@hakhandelwal11
Copy link

Probelm:
This PR fixes an issue where config path comparisons fail in Windows environments due to differences in file path syntax. While macOS/Linux use forward slashes (/), Windows uses backward slashes (), causing mismatches in string-based comparisons.
Additionally, this change ensures that the include statement is not duplicated by correctly matching existing config paths across platforms.

Solution
Added a Windows-specific normalization step to ensure paths are converted before comparison.
Updated condition:
if strings.Contains(conf, makeIncludeBrevStr(toWindowsPath(brevConfigPath)))
This ensures that when running in a Windows environment, the config path is converted to Windows format before being used in the comparison, preventing duplicate include entries.

@hakhandelwal11 hakhandelwal11 marked this pull request as ready for review March 19, 2026 06:32
@hakhandelwal11 hakhandelwal11 requested a review from a team as a code owner March 19, 2026 06:32
@hakhandelwal11 hakhandelwal11 self-assigned this Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant