diff --git a/src/courses/advanced/05.md b/src/courses/advanced/05.md index 946311028..91e4cfe01 100644 --- a/src/courses/advanced/05.md +++ b/src/courses/advanced/05.md @@ -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