pygit2 icon indicating copy to clipboard operation
pygit2 copied to clipboard

Merging leaves repo in "still merging" state

Open meowcat opened this issue 2 years ago • 1 comments

After executing a merge as suggested in the docs, a git status suggests that "you are still merging".

Bash:

git init mergable
cd mergable
echo a > a
git add .
git commit -m "initial"
git switch -c mergy
echo b > b
git add b
git commit -m "additional"
git switch master
cd ..
git clone mergable mergable-clone

Python:

import pygit2
r = pygit2.Repository("mergable-clone")
mergy = r.references["refs/remotes/origin/mergy"]
parents = [r.head.target, mergy.target]
r.merge(mergy.target)

r.create_commit(
    "HEAD",
    pygit2.Signature("aaa", "[email protected]"),
    pygit2.Signature("aaa", "[email protected]"),
    "merge",
    r.index.write_tree(),
    parents
)

Bash:

cd mergable-clone
git status

Returns:

On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)

All conflicts fixed but you are still merging.
  (use "git commit" to conclude merge)

Another git commit silences the message.

meowcat avatar Aug 30 '23 09:08 meowcat

Oh, it's a duplicate of #1081. The behaviour is fine, but it would be great if this was documented in the docs.

meowcat avatar Aug 30 '23 09:08 meowcat