libgit2 / libgit2/libgit2sharp

Git stash pop behaviour with

Open
#1,844 0 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
  • In branch A with master as remove we have a new file untracked.
  • In master we have added the same file already and it's part of commit a123

we are updating branch A to the commit a123 so we are doing:

var stash = repository.Stashes.Add(signature, StashModifiers.IncludeUntracked);
repository.Merge('a123', signature);

if (stash != null)
{
	repository.Stashes.Pop(0);
}

if(repository.Index.Conflicts.Any()){
      showUserAllTheConflictsAndGiveOptionsToFixThem
}
Expected behavior

When doing the Pop the change should get marked as having a conflict and being modified

Actual behavior

There won't be any conflicts even though the file is marked as modified and has been modified with the conflict markers

Version of LibGit2Sharp (release number or SHA1)

0.27.0-preview-0034

Operating system(s) tested; .NET runtime tested

Windows Server 2012; .NET 4.7.2

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 case using repository.Stashes.Add with IncludeUntracked, repository.Merge, repository.Stashes.Pop(0), and repository.Index.Conflicts on LibGit2Sharp 0.27.0-preview-0034. First inspect how stash pop reports conflicts when an untracked file collides with a tracked file, then verify that the conflict is exposed through the index while the working file remains modified with conflict markers.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.