Skip to content
This repository was archived by the owner on Apr 14, 2023. It is now read-only.

Commit fc4d553

Browse files
committed
Improve detection of ref name vs branch name
1 parent 91e9677 commit fc4d553

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ module.exports = function(options) {
5151
cmdRevParse.stdout.on('data', function(data) {
5252
if (options.debug) gutil.log(gutil.colors.magenta('git rev-parse: ') + data.toString().trim());
5353
branch = data.toString().trim();
54-
if (branch.indexOf('/') > -1) {
55-
branch = branch.substr(branch.lastIndexOf('/') + 1);
54+
if (branch.indexOf('refs/heads/') > -1) {
55+
branch = branch.substr(branch.lastIndexOf('refs/heads/') + 1);
5656
}
5757
gutil.log(gutil.colors.yellow('Current branch: ' + branch));
5858
});
@@ -73,8 +73,8 @@ module.exports = function(options) {
7373
});
7474
} else {
7575
branch = process.env['GIT_BRANCH'];
76-
if (branch.indexOf('/') > -1) {
77-
branch = branch.substr(branch.lastIndexOf('/') + 1);
76+
if (branch.indexOf('refs/heads/') > -1) {
77+
branch = branch.substr(branch.lastIndexOf('refs/heads/') + 1);
7878
}
7979
var found = false;
8080
options.branches.forEach(function (b) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gulp-deploy-git",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"description": "Deploy Git projects to remote Git repositories.",
55
"author": "Thomas Lokshall <[email protected]>",
66
"license": "MIT",

0 commit comments

Comments
 (0)