Skip to content

fix: updated gitignore paths to use forward slashes on Windows#10450

Open
chrisbutulis wants to merge 1 commit into
treeverse:masterfrom
chrisbutulis:fix/gitignore-slashes
Open

fix: updated gitignore paths to use forward slashes on Windows#10450
chrisbutulis wants to merge 1 commit into
treeverse:masterfrom
chrisbutulis:fix/gitignore-slashes

Conversation

@chrisbutulis

Copy link
Copy Markdown

Closes #10449

Change Description

Background

This fix ensures that automatic .gitignore entries are generated with backslashes on linux-based systems as well as on Windows-based systems.

Bug Fix

  1. Problem - Currently the gitignore entries for directories generated using lakectl clone generate with backslashes on Windows, causing the .gitignore to malfunction and not actually ignore the directories.
  2. Root cause - The function createEntriesForIgnore in git.go doesn't universalize file paths; it uses the convention of the user's operating system
  3. Solution - I fixed the bug by wrapping the filepath.join() call in a filepath.ToSlash() call in createEntriesForIgnore, which changes directory backslashes forward slashes.

Testing Details

I added a testing file in the pkg/git subdirectory called git_internal_test.go, as the function createEntriesForIgnore is internal to the package "git". The test verifies that a temporary test directory is correctly named with a forward slash. The test passes locally on Windows.

Breaking Change?

Not that I am aware of.

Additional info

N/A

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot added the area/testing Improvements or additions to tests label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/testing Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: lakectl local clone does not update .gitignore correctly on Windows

4 participants