Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git commit exit code is 0 if permission checks fail on .git/objects #18

Closed
sirnewton01 opened this issue Jul 9, 2018 · 2 comments
Closed
Labels

Comments

@sirnewton01
Copy link
Collaborator

Create a git repository. Change the filesystem permissions to prevent writes to the .git/objects/?? files.

chmod a-w .git/objects .git/objects/??

Try committing. The commit fails with an error message.

Err: No changes staged for commit.

But, the exit code is 0, which would cause an automated script to assume that the commit succeeded.

$ echo $?
0
@driusan driusan added the bug label Jul 9, 2018
@driusan driusan reopened this Jul 10, 2018
@driusan
Copy link
Owner

driusan commented Jul 10, 2018

Oops.. commit ID referenced the wrong issue.

@driusan
Copy link
Owner

driusan commented Jul 10, 2018

Actually, wait, no, that did fix it.

It dies in weird ways now, (claims "Invalid tree"), but the real git client dies in weird ways too (claims "not a git repository")

@driusan driusan closed this as completed Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants