Skip to content

Commit

Permalink
Merge fix/new-branch-cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain Lenzotti committed Sep 28, 2018
2 parents 263afee + fe6c609 commit 859b413
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@
"url": "https://github.com/Romakita/gflow/issues"
},
"homepage": "https://github.com/Romakita/gflow"
}
}
19 changes: 12 additions & 7 deletions src/git/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,19 @@ module.exports = {
return module.exports
.branches(...args)
.map(branch => {
const [date, creation, author] = module.exports.show(branch).split('|');
return {
branch,
date,
creation,
author
};
try {
const [date, creation, author] = module.exports.show(branch).split('|');
return {
branch,
date,
creation,
author
};
} catch (er) {
return undefined;
}
})
.filter((b) => !!b)
.sort((info1, info2) => info1.date < info2.date);
},

Expand Down
2 changes: 1 addition & 1 deletion src/utils/normalize-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const config = require('../config');

module.exports = {
normalizeBranchName({ fromBranch, branchName, type }) {
const paths = [type || config.branchTypes.default, branchName.replace(/[- _/]/gi, config.charReplacement)];
const paths = [config.branchTypes[type] || config.branchTypes.default, branchName.replace(/[- _/]/gi, config.charReplacement)];

fromBranch = fromBranch.replace(`${config.remote}/`, '');

Expand Down

0 comments on commit 859b413

Please sign in to comment.