-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Provide a git_stash_apply() API #2636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Side question: when I look up at the tree corresponding to the stash (whether or not it's created using CLT or libgit2), I don't see my untracked file "text.txt" - why is that?
|
Looking at the source code for git_stash_save() I see it is indeed creating 2 extra commits for the index and untracked files, so I understand where the topology observed in git objects is coming from. Then the stash commit has 3 parents: these 2 commits and the base / HEAD commit. How are you supposed to reply these commits? PS: Any plans to add a git_stash_apply() API? |
I got this to work but I have the feeling I'm hacking this around and I'm not sure I'm doing this right:
|
The actual implementation of |
See PR #2705. |
I'm trying to reproduce the behavior of
git stash -u
followed bygit stash apply
in libgit2. I can create the stash properly in libgit2 and applying it with the git CLT works. However, if I try to apply it with libgit2, the untracked files are not restored.(stash.private is actually a git_commit* retrieved with git_commit_lookup() after creating the stash)
What am I doing wrong?
The text was updated successfully, but these errors were encountered: