libgit2 / libgit2/libgit2sharp

The set filemode is incorrect

Open
#1,953 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

Reproduction steps

Azure DevOps

  1. Create YAML Pipeline just for monitoring filemode (show all files with filemode, script: git ls-files --stage) and create build validation policy for main branch

  2. Create file "test1.sh" in folder "folder1", create PR to main and complete it

  3. On new branch make changes, push it, hard reset to previous commit, create "folder2", move "test1.sh" to this folder, change filemode to 100755 (git update-index --chmod=+x file_name), force push, create PR to main and complete it

  4. Switch to previous commit (before changing folder and file mode), push any changes, create PR to main and check build validation pipeline logs on the PR

Expected behavior

File mode is 100755 (new)

Actual behavior

File mode is 100644 (old)

Version of LibGit2Sharp (release number or SHA1)

14.0.29222.1

Operating system(s) tested; .NET runtime tested

Windows 10, .NET 4.8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Azure DevOps scenario using git ls-files --stage, the move to folder2, and git update-index --chmod=+x. Then trace LibGit2Sharp's handling of file modes across the described commit and push sequence. Done means the validation pipeline reports file mode 100755 rather than 100644 for the affected file.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.