Skip to content

Commit

Permalink
Advanced 5 - Used simpler functions for current_branch
Browse files Browse the repository at this point in the history
Signed-off-by: Shivani Karikar <[email protected]>
  • Loading branch information
karikarshivani authored Dec 13, 2024
1 parent 9dab6bc commit ac11755
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/courses/advanced/05.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,10 @@ class Git < Inspec.resource(1)
end

def current_branch
branch_name = inspec.command("git --git-dir #{@path} branch").stdout.strip.split("\n").find do |name|
branch_name = inspec.command("git --git-dir #{@path} branch").stdout.gsub(" ", "").split("\n").find do |name|
name.start_with?('*')
end
branch_name.gsub(/^\*/,'').strip
branch_name[1..-1]
end

end
Expand Down

0 comments on commit ac11755

Please sign in to comment.