Skip to content
Snippets Groups Projects
Commit 6bf91de9 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Merge branch 'git_branch' into 'master'

Ensure GIT_BRANCH non-empty when not on a branch

If HEAD is detached e.g. during `git bisect`, GIT_BRANCH ends up empty, which causes an error at runtime. This change grabs the description from `git branch`, which is either the branch name or something like `(HEAD detached at <hash>)` on recent versions or `(no branch)` in older versions. Works with BSD and GNU sed, and git >= 1.0.0b (at least) although detached HEAD only introduced in 1.5.0.

See merge request !47
parents 1a8b0e63 a73d8447
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment