Skip to content

Wrong mode mask when adding files to the index #430

Description

@GaretJax

0fdf6c3 changed the mode mask from 0o111 to 0o100. We're encountering issues when committing files marked as executable:

After committing such a file with GitPython, our repo shows the following behavior:

# git status
On branch develop
nothing to commit, working directory clean

git status shows everything as clean (as it should be).

But if we git stash the changes:

# git stash
error: feeding unmodified <file> to diffcore
error: feeding unmodified <file> to diffcore
Saved working directory and index state WIP on develop: 6cdd426 ... (10136)
HEAD is now at 6cdd426 ... (10136)

And the stash turns up empty:

# git stash show

This is an issue for us because we end up in a dirty repo and can't execute some git commands anymore without resetting/stashing some inexistent changes.

I don't know what the rational behind the 0o100 mask is, but 0o111 works for our use case.

Activity

  1. GaretJax commented on May 11, 2016

    @GaretJax
    Author

    Also if you look at this https://github.com/libgit2/libgit2/blob/master/include/git2/types.h#L208-L209, the only two allowed modes are 0755 and 0644.

  2. self-assigned this
    on May 19, 2016
  3. added this to the v2.0.3 - Bugfixes milestone on May 19, 2016
  4. Byron commented on May 19, 2016

    @Byron
    Member

    Thanks so much for reporting this one ! It seems like a major bug caused by just a few digits. The next commit will contain the fix, and I will make a new point release in the next days as well.

    Also thanks for investigating a possible fix - using 0o100 doesn't seem sensible here at all.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions