Skip to content

Commit

Permalink
Yet another method of resolving the branch name 😪
Browse files Browse the repository at this point in the history
Work for #196

[release]
  • Loading branch information
atruskie committed Apr 6, 2020
1 parent 1784737 commit d1629bc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/git_version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ $self_contained = if ($self_contained -eq 'true') { 'true' } else { 'false' }

$commit_hash = git show -s --format="%H"

$rev_head = git rev-parse HEAD
$branches = git for-each-ref --format='%(objectname) %(refname:short)' refs/heads | Where-Object { $_.StartsWith($rev_head) } | ForEach-Object { ($_ -split ' ')[1] }
Write-output "git brnaches: $($branches -join ' ')"
$branch = $branches -join ' '
Write-output "branch: $branch"
$branch = ((git show -s --pretty=%D HEAD) -split ',').Trim().TrimStart('origin/') | Where-Object { -not $_.Contains("HEAD") }


$describe = git describe --dirty --abbrev --long --always

Expand Down

0 comments on commit d1629bc

Please sign in to comment.