Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions generate/input/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -2175,6 +2175,11 @@
}
},
"git_stash_save": {
"args": {
"message": {
"isOptional": true
}
},
"isAsync": true,
"return": {
"isErrorCode": true
Expand Down
12 changes: 9 additions & 3 deletions test/tests/stash.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ describe("Stash", function() {
});
});

it("can save and drop a stash", function() {
function saveDropStash(repo, stashMessage) {
var fileName = "README.md";
var fileContent = "Cha-cha-cha-chaaaaaangessssss";
var repo = this.repository;
var filePath = path.join(repo.workdir(), fileName);
var oldContent;
var stashes = [];
var stashOid;
var stashMessage = "stash test";

return fse.readFile(filePath)
.then(function(content) {
Expand Down Expand Up @@ -82,6 +80,14 @@ describe("Stash", function() {
return Promise.reject(e);
});
});
}

it("can save and drop a stash", function() {
saveDropStash(this.repository, "stash test");
});

it("can save a stash with no message and drop it", function() {
saveDropStash(this.repository, null);
});

it("can save and pop a stash", function() {
Expand Down