Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

git-branch-description

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-branch-description - npm Package Compare versions

Comparing version
1.1.7
to
1.1.8
+1
-1
package.json
{
"name": "git-branch-description",
"version": "1.1.7",
"version": "1.1.8",
"description": "manage branch description via branch-description.properties",

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

@@ -1,11 +0,15 @@

var os = require('os');
var exec = require('child_process').execSync;
var parser = require('./parser');
function trimSingleQuote(br) {
return ` ${br} `.replace(/(\s)'/g, '$1').replace(/'(\s)/g, '$1').trim();
}
exports.localBranches = function() {
var branches = exec(`git for-each-ref --format='%(refname)' refs/heads/`, {
var branches = exec(`git for-each-ref --format='%(refname:short)' refs/heads/`, {
cwd: parser.getRootDir()
}).toString().trim();
}).toString();
branches = trimSingleQuote(branches);
branches = branches.replace(/(^|\n)refs\/heads\//g, '$1').split(os.EOL);
branches = branches.split(/\s+/);

@@ -16,8 +20,9 @@ return branches;

exports.remoteBranches = function(replaceRemoteName) {
var branches = exec(`git for-each-ref --format='%(refname)' refs/remotes/`).toString().trim();
branches = branches.replace(/(^|\n)refs\/remotes\//g, '$1');
var branches = exec(`git for-each-ref --format='%(refname:short)' refs/remotes/`).toString().trim();
branches = trimSingleQuote(branches);
replaceRemoteName && (branches = branches.replace(/(^|\n)\w+\//g, '$1'));
branches = branches.split(os.EOL);
branches = branches.split(/\s+/).filter(function(br) {
return replaceRemoteName ? br !== 'HEAD' : !/^\w+\/HEAD$/.test(br);
});
return branches;

@@ -24,0 +29,0 @@ }