cmake: refactor GitUtilities.cmake
Remote branch name can now be resolved from detached HEAD.
This commit is contained in:
parent
fb34898a29
commit
5b1345cfd1
1 changed files with 3 additions and 3 deletions
|
|
@ -26,7 +26,7 @@ function(git_current_branch variable)
|
|||
|
||||
# If a detached head, a ref could still be resolved.
|
||||
if("${output}" STREQUAL "")
|
||||
_git_command(describe --all --exact-match --exclude */HEAD)
|
||||
_git_command(describe --all --exact-match)
|
||||
|
||||
# Get the ref, in the form heads/master or
|
||||
# remotes/origin/master so isolate the final part.
|
||||
|
|
@ -50,8 +50,8 @@ function(git_working_tree_dirty variable)
|
|||
endif()
|
||||
endfunction()
|
||||
|
||||
function(git_subject variable)
|
||||
_git_easy_command(log -1 --format=%s)
|
||||
function(git_summary variable)
|
||||
_git_easy_command(log -1 "--format=%h %s")
|
||||
endfunction()
|
||||
|
||||
function(get_git_dir variable)
|
||||
|
|
|
|||
Loading…
Reference in a new issue