Skip to content

Commit

Permalink
Merge pull request #22 from seth/sf/use-rev-parse
Browse files Browse the repository at this point in the history
Use git rev-parse to obtain current branch name
  • Loading branch information
uwiger committed Feb 4, 2013
2 parents 35f8296 + 1bcdaff commit 74bdbb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/edown_doclet.erl
Expand Up @@ -225,11 +225,11 @@ do_redirect(Href, Prefix) ->
end.

get_git_branch() ->
case os:cmd("git describe --always --all") of
case os:cmd("git rev-parse --abbrev-ref HEAD") of
"fatal:" ++ _ -> "master"; % sensible default
Git ->
case string:tokens(Git, " \n/") of
[_, Branch] -> Branch;
case string:tokens(Git, " \n") of
[Branch] -> Branch;
Other -> erlang:error({cannot_get_git_branch, Other})
end
end.
Expand Down

0 comments on commit 74bdbb3

Please sign in to comment.