libgit2 / libgit2/pygit2

pygit2 unable to commit changes

Open
#1,099 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.7k
Forks
408
Avg merge
2d 57m
Merged PRs (30d)
7

Description

pygit2 == 1.7.0

I have been trying to commit changes to repo but unable to do so

snippet
oid = repository.create_commit(<branch_name>, author, commiter, message, tree, [repository.head.get_object().hex])
author and commiter are already defined

looks like get_object. was deprecated in newer version . are there any work arounds in latest version for commiting changes

error >>

KeyError: 'the requested type does not match the type in the ODB'

let know if any more details are needed

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 repository.create_commit call in pygit2 1.7.0 and the repository.head.get_object() expression shown in the report. Reproduce the KeyError with the provided snippet and verify the expected current API for obtaining the parent commit. Done means the reported commit operation succeeds or the issue is narrowed with the missing repository, object-type, and version details.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.