Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodegit-flow

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodegit-flow - npm Package Compare versions

Comparing version 0.1.16 to 0.1.17

22

build/src/Feature.js

@@ -144,3 +144,3 @@ 'use strict';

if (!cancelDevelopMerge) {
return NodeGit.Merge.commits(repo, developCommit, featureCommit);
return utils.Repo.merge(developBranch, featureBranch, repo);
} else if (isRebase && !isSameCommit) {

@@ -150,22 +150,2 @@ return utils.Repo.rebase(developBranch, featureBranch, repo);

return Promise.resolve();
}).then(function (index) {
if (cancelDevelopMerge) {
return Promise.resolve();
}
if (!index.hasConflicts()) {
index.write();
return index.writeTreeTo(repo);
}
// Reject with the index if there are conflicts
return Promise.reject(index);
}).then(function (oid) {
if (cancelDevelopMerge) {
return Promise.resolve(featureCommit);
}
var ourSignature = repo.defaultSignature();
var commitMessage = utils.Merge.getMergeMessage(developBranch, featureBranch);
return repo.createCommit(developBranch.name(), ourSignature, ourSignature, commitMessage, oid, [developCommit, featureCommit]);
}).then(function (_mergeCommit) {

@@ -172,0 +152,0 @@ mergeCommit = _mergeCommit;

@@ -144,30 +144,6 @@ 'use strict';

if (!cancelMasterMerge) {
return NodeGit.Merge.commits(repo, hotfixCommit, masterCommit);
return utils.Repo.merge(masterBranch, hotfixBranch, repo);
}
return Promise.resolve();
}).then(function (index) {
if (cancelMasterMerge) {
return Promise.resolve();
}
if (!index.hasConflicts()) {
index.write();
// Write the merge index to the repo
return index.writeTreeTo(repo);
}
// Reject with the index if there are conflicts
return Promise.reject(index);
}).then(function (oid) {
if (cancelMasterMerge) {
return Promise.resolve(masterCommit);
}
var ourSignature = repo.defaultSignature();
var commitMessage = utils.Merge.getMergeMessage(masterBranch, hotfixBranch);
// Create the merge commit of hotfix into master
return repo.createCommit(masterBranch.name(), ourSignature, ourSignature, commitMessage, oid, [masterCommit, hotfixCommit]);
}).then(function (oid) {
return NodeGit.Commit.lookup(repo, oid);

@@ -186,25 +162,5 @@ })

if (!cancelDevelopMerge) {
return NodeGit.Merge.commits(repo, hotfixCommit, developCommit);
return utils.Repo.merge(developBranch, hotfixBranch, repo);
}
return Promise.resolve();
}).then(function (index) {
if (cancelDevelopMerge) {
return Promise.resolve();
}
if (!index.hasConflicts()) {
index.write();
return index.writeTreeTo(repo);
}
// Reject with the index if there are conflicts
return Promise.reject(index);
}).then(function (oid) {
if (cancelDevelopMerge) {
return Promise.resolve(hotfixCommit);
}
var ourSignature = repo.defaultSignature();
var commitMessage = utils.Merge.getMergeMessage(developBranch, hotfixBranch);
return repo.createCommit(developBranch.name(), ourSignature, ourSignature, commitMessage, oid, [developCommit, hotfixCommit]);
}).then(function (_mergeCommit) {

@@ -211,0 +167,0 @@ mergeCommit = _mergeCommit;

@@ -153,30 +153,6 @@ 'use strict';

if (!cancelMasterMerge) {
return NodeGit.Merge.commits(repo, releaseCommit, masterCommit);
return utils.Repo.merge(masterBranch, releaseBranch, repo);
}
return Promise.resolve();
}).then(function (index) {
if (cancelMasterMerge) {
return Promise.resolve();
}
if (!index.hasConflicts()) {
index.write();
// Write the merge index to the repo
return index.writeTreeTo(repo);
}
// Reject with the index if there are conflicts
return Promise.reject(index);
}).then(function (oid) {
if (cancelMasterMerge) {
return Promise.resolve(masterCommit.id());
}
var ourSignature = repo.defaultSignature();
var commitMessage = utils.Merge.getMergeMessage(masterBranch, releaseBranch);
// Create the merge commit of release into master
return repo.createCommit(masterBranch.name(), ourSignature, ourSignature, commitMessage, oid, [masterCommit, releaseCommit]);
}).then(function (oid) {
return NodeGit.Commit.lookup(repo, oid);

@@ -194,25 +170,5 @@ })

if (!cancelDevelopMerge) {
return NodeGit.Merge.commits(repo, releaseCommit, developCommit);
return utils.Repo.merge(developBranch, releaseBranch, repo);
}
return Promise.resolve();
}).then(function (index) {
if (cancelDevelopMerge) {
return Promise.resolve();
}
if (!index.hasConflicts()) {
index.write();
return index.writeTreeTo(repo);
}
// Reject with the index if there are conflicts
return Promise.reject(index);
}).then(function (oid) {
if (cancelDevelopMerge) {
return Promise.resolve(releaseCommit);
}
var ourSignature = repo.defaultSignature();
var commitMessage = utils.Merge.getMergeMessage(developBranch, releaseBranch);
return repo.createCommit(developBranch.name(), ourSignature, ourSignature, commitMessage, oid, [developCommit, releaseCommit]);
}).then(function (_mergeCommit) {

@@ -219,0 +175,0 @@ mergeCommit = _mergeCommit;

2

build/src/utils/MergeUtils.js

@@ -5,3 +5,3 @@ "use strict";

getMergeMessage: function getMergeMessage(toBranch, fromBranch) {
return "Merged branch " + fromBranch.shorthand() + " into " + toBranch.shorthand();
return "Merged " + fromBranch.shorthand() + " into " + toBranch.shorthand();
}

@@ -8,0 +8,0 @@ };

'use strict';
var Promise = require('nodegit-promise');
var NodeGit = require('nodegit');
var RepoUtils = {
merge: function merge(toBranch, fromBranch, repo) {
return repo.mergeBranches(toBranch.name(), fromBranch.name(), null, NodeGit.Merge.PREFERENCE.NO_FASTFORWARD).then(function (result) {
if (result.hasConflicts && result.hasConflicts()) {
return Promise.reject(result);
}
return Promise.resolve(result);
});
},
rebase: function rebase(toBranch, fromBranch, repo) {

@@ -7,0 +17,0 @@ return repo.rebaseBranches(fromBranch.name(), toBranch.name(), undefined, undefined).then(function (result) {

{
"name": "nodegit-flow",
"version": "0.1.16",
"version": "0.1.17",
"description": "nodegit-flow contains gitflow methods that aren't include in the vanilla nodegit package",

@@ -5,0 +5,0 @@ "main": "build/src/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc