Skip to content

Add Keep to ResetOptions #1031

@kkrime

Description

@kkrime

When running:

err = wt.Reset(&git.ResetOptions{ Mode: git.HardReset })

Untracked files are over written.

when running the git equivalent
git reset HEAD --hard

untracked files are left alone.

Also, when running:
wt.Checkout(&git.CheckoutOptions{Branch: plumbing.ReferenceName("refs/heads/main"), Force: true})
Untracked files are over written.

when running the git equivalent
git checkout main -f

untracked files are left alone.

I think that the behaviour should be the same, as untracked files are not apart of the repo and this is causing me issues with my work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededno-autocloseIssues/PRs to be ignored by stale bot

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions