libgit2 / libgit2/libgit2sharp

Commit indexer is not working for repository root

Open
#1,516 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I am creating Virtual File system for my application. As input I am getting file paths or directory paths. I found that app works perfectly for any paths except for root.

Technically speaking I cannot get TreeEntry for repo root directory.

            Commit commit = GetCommit(commitHash);

            // this works
            var file = commit["foo.txt"];
            var dir1 = commit["var/logs"];
            var dir2 = commit["var"];

            // this doesn't work
            ver rootDir = commit["/"]; // returns null

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 difference between commit["foo.txt"], commit["var"], and commit["/"] using the commit indexer and TreeEntry behavior described here. Trace how the indexer resolves the repository root, then verify that a root lookup returns the expected TreeEntry without breaking file or nested-directory lookups.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.