Skip to content

Conversation

@mathijs81
Copy link
Contributor

🧢 Changes

I cloned the repo and tried cargo test but ran into issues because my default umask seems to be 0002 (I'm running Ubuntu 24.04).
These changes make cargo test run through and I think should also work on all other systems.

@vercel
Copy link

vercel bot commented Nov 25, 2025

@mathijs81 is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the rust Pull requests that update Rust code label Nov 25, 2025
@Byron
Copy link
Collaborator

Byron commented Nov 26, 2025

Thanks a lot for the fix, it's much appreciated!

I wonder if @slarse also ran into this? If not, maybe it really is only about the umask somehow.
In any case, it's probably OK to wait until git2 is no more.

@mathijs81
Copy link
Contributor Author

Even with the right umask, the forced_changes_with_snapshot_and_directory_to_file test kept failing as described in the comment, with libgit2 complaining that the Oid is null/not found when it's supposed to do the checkout, I couldn't figure out either why that's happening.

@Byron Byron disabled auto-merge November 26, 2025 08:38
@Byron
Copy link
Collaborator

Byron commented Nov 26, 2025

Do you want to add more commits/linux specific exclusions to make this work?

Maybe the CI specific checks should really be Linux checks?

@Byron Byron added the feedback requested Feedback was requested to help resolve the issue label Nov 26, 2025
mathijs81 and others added 2 commits November 26, 2025 12:10
- remove the now unnecessary CI check - we know it's (mostly?) happening on Linux
@mathijs81
Copy link
Contributor Author

I tested on a second 24.04 machine and needed to add a couple more umask normalizations.
With these changes all tests pass for me on both those Ubuntu 24.04 machines (including the two other ones in checkout.rs that are disabled for the CI), so I think it's not needed to exclude linux further?

@Byron Byron removed the feedback requested Feedback was requested to help resolve the issue label Nov 26, 2025
@Byron Byron enabled auto-merge November 26, 2025 11:18
@Byron
Copy link
Collaborator

Byron commented Nov 26, 2025

That's good to hear, thanks so much!

Let's have it!

@Byron Byron merged commit bfd2ee5 into gitbutlerapp:master Nov 26, 2025
20 of 22 checks passed
@slarse
Copy link
Contributor

slarse commented Nov 26, 2025

@Byron I had umask issues as well, but not exactly the same ones as my umask is different. In fact, I still have umask issues if I set a more restrictive umask (e.g. 0077).

Isn't it more convenient to just look at the filetype and normalize based on that, instead of building up a sort of library of possible outcomes from different umasks? When it comes to Git, the permission bits are really only interesting when it comes to regular files anyway.

Edit: Concrete suggestion in #11375. It should more generally cover different umasks.

@Byron
Copy link
Collaborator

Byron commented Nov 27, 2025

Thanks for flagging this hackery that has been going on here. The mapping was originally made by me as a sure-fire way of making the test work on CI, so I wanted it to work for sure, going with stupid simple.
Now that crutch is growing, and that should not continue :).

Thanks also for the fix, I am heading over there now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants