Skip to content
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

git meta stash pop should not drop item in case of conflict #747

Open
shijinglu opened this issue Jan 10, 2020 · 1 comment
Open

git meta stash pop should not drop item in case of conflict #747

shijinglu opened this issue Jan 10, 2020 · 1 comment

Comments

@shijinglu
Copy link
Collaborator

As vanilla git says:

pop [--index] [-q|--quiet] []
Remove a single stashed state from the stash list and apply it on top of the current working tree state, i.e., do the inverse operation of git stash push. The working directory must match the index.
Applying the state can fail with conflicts; in this case, it is not removed from the stash list. You need to resolve the conflicts by hand and call git stash drop manually afterwards.

@shijinglu
Copy link
Collaborator Author

shijinglu commented Jan 15, 2020

I don't think this can be fixed easily, because NodeGit.Stash.apply does not return the code it promised to:

> NodeGit.Repository.open('/Users/abc/workspace/twosigma/big-mono/s123').then(function (repo){
... NodeGit.Stash.apply(repo, 0, null).then( function(result){
..... console.log(" result = " + result);
..... });
... })
Promise { _55: 0, _87: null, _28: [] }
>  result = undefined

Supposedly, it should return something like

result = 0, 1, -13 etc

We need this code so we can tell if there is a conflict at applying:
https://github.com/libgit2/libgit2/blob/HEAD/include/git2/stash.h#L182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant