From 7d24a402f7d2c042a72f6c99ef906d11fcf6d0ce Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 10 May 2019 19:06:38 -0400 Subject: [PATCH] Fixes #737 - avoids using lstrip lstrip is only supported in more recent git versions --- src/git/parsers/branchParser.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/git/parsers/branchParser.ts b/src/git/parsers/branchParser.ts index bd507df..006727e 100644 --- a/src/git/parsers/branchParser.ts +++ b/src/git/parsers/branchParser.ts @@ -11,7 +11,7 @@ const rb = '%3e'; // `%${'>'.charCodeAt(0).toString(16)}`; export class GitBranchParser { static defaultFormat = [ `${lb}h${rb}%(HEAD)`, // HEAD indicator - `${lb}n${rb}%(refname:lstrip=1)`, // branch name + `${lb}n${rb}%(refname)`, // branch name `${lb}u${rb}%(upstream:short)`, // branch upstream `${lb}t${rb}%(upstream:track)`, // branch upstream tracking state `${lb}r${rb}%(objectname)` // ref @@ -54,14 +54,14 @@ export class GitBranchParser { behind = 0; } - if (name.startsWith('remotes/')) { - // Strip off remotes/ - name = name.substr(8); + if (name.startsWith('refs/remotes/')) { + // Strip off refs/remotes/ + name = name.substr(13); remote = true; } else { - // Strip off heads/ - name = name.substr(6); + // Strip off refs/heads/ + name = name.substr(11); remote = false; }