Project

General

Profile

Actions

Defect #31120

closed

Garbage lines in the output of 'git branch' break git adapter

Added by Chad Petersen almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
SCM
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

I found that adding an if condition around line 84-89 solves the issue.

change:

branch_rev = line.match('\s*(\*?)\s*(.*?)\s*([0-9a-f]{40}).*$')
bran = GitBranch.new(branch_rev[2])
bran.revision =  branch_rev[3]
bran.scmid    =  branch_rev[3]
bran.is_default = ( branch_rev[1] == '*' )
@branches << bran

To:

if branch_rev = line.match('\s*(\*?)\s*(.*?)\s*([0-9a-f]{40}).*$')
  bran = GitBranch.new(branch_rev[2])
  bran.revision =  branch_rev[3]
  bran.scmid    =  branch_rev[3]
  bran.is_default = ( branch_rev[1] == '*' )
  @branches << bran
end


Files

31120.patch (1.09 KB) 31120.patch Fix by Chad Petersen Go MAEDA, 2019-03-31 06:39
Actions

Also available in: Atom PDF