nodegit / nodegit/nodegit

index.read(true) is a (wrongly) no-op

Open
#1,478 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.8k
Forks
704
PR merge metrics
No merged PRs in 30d

Description

I expect that if I make an index change, but don't call index.write(), and then call index.read(true), my index change should be erased. But that doesn't appear to be what happens.

Failing test case attached:
fail.txt

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

Start with the attached fail.txt test case and trace the index.read(true) and index.write() calls in the NodeGit API. Compare the observed behavior with the expected reset semantics, then add or update a regression test showing that an unwritten index change is discarded by index.read(true).

Written by the indexing model from the issue text.

Assessment

Tech stack
git, javascript, nodejs
Domain
tooling
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.