-
Notifications
You must be signed in to change notification settings - Fork 697
Closed
Description
hi,
it looks like Repository.createCommitOnHead ignores the first argument filesToAdd. it is not using it at all, and instead adds all the files!
and that is why this function to create empty commits doesn't work as expected when there are (unstaged) files with changes:
function createEmptyCommit(repo, message, sig) {
var files = []; // <--
sig = sig || createSignature();
var author = sig;
var committer = sig;
return unstageAll(repo) // make sure commit is in fact empty. (does a mixed reset)
.then(function() {
return repo.createCommitOnHead(
files,
author,
committer,
message
);
})
.catch(function(err) {
handleError(err);
});
}Metadata
Metadata
Assignees
Labels
No labels