libgit2 / libgit2/libgit2sharp
Using CherryPick with CommitOnSuccess = false
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
Reproduction steps
using (var repo = new Repository("path\to\repo"))
{
var commit1 = repo.Lookup<Commit>("a05b011d89bbd5c9117840b71718ce2a1ee00376");
var masterTb = repo.Branches["refs/remotes/origin/release/1.0"];
var master = repo.CreateBranch("release/1.0", masterTb.Tip);
var updateMb = repo.Branches.Update(master,
b => b.TrackedBranch = masterTb.CanonicalName);
Commands.Checkout(repo, updateMb);
var result = repo.CherryPick(commit1, commit1.Author, new CherryPickOptions { CommitOnSuccess = false});
}
If i use CherryPick with CommitOnSuccess = false repo is left in cherry-pick state. For rebase there is abort and continue commands, but for cherry pick there is non.
I checked up code and if i use CommitOnSuccess = true there is git_repository_state_cleanup which clean up chery-pick state.
Is this a bug or there is some commands to reset state?
Expected behavior
cherry picked and exit cherry-pick state
Actual behavior
left in cherry-pick state
Version of LibGit2Sharp (release number or SHA1)
0.26.2
Operating system(s) tested; .NET runtime tested
Windows 10 Version 2004 10.0.19041
.Net Core 3.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Repository.CherryPick API and its CherryPickOptions handling; compare the CommitOnSuccess=false path with the rebase abort/continue behavior and the git_repository_state_cleanup call described in the report. Reproduce the supplied snippet against LibGit2Sharp 0.26.2; done means the repository no longer remains in cherry-pick state, or the supported reset behavior is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100