Thanks to visit codestin.com
Credit goes to github.com

Skip to content

git_status_file() returns GIT_STATUS_WT_NEW | GIT_STATUS_INDEX_DELETED for unmerged paths #2728

@swisspol

Description

@swisspol

As part of writing extra tests for #2705, I found that git_status_file() returns GIT_STATUS_WT_NEW | GIT_STATUS_INDEX_DELETED for unmerged paths e.g. for what in this case:

$ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    modified:   who

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

    both modified:   what

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    when

$ cat what 
<<<<<<< ours
ciao
=======
goodbye
>>>>>>> theirs

Some questions:

  1. Is this the expected behavior or a bug / unsupported case?
  2. What's the proper why of detecting that a file is in an unmerged state in the workdir?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions