diff options
author | Jo-Philipp Wich <jo@mein.io> | 2017-02-20 14:14:49 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2017-02-20 14:16:26 +0100 |
commit | 79992f1a670aad9306d96d61b8df83d2cd397ed1 (patch) | |
tree | 49cf4038b1dd2e8abafc30d5d67655b39a7ce86b | |
parent | f535090ffcbe3e0fbb394eb443cc65d6ddb8cefa (diff) |
luci.mk: fix branch detection in detached HEAD state
When LuCI is checked out via pinned feeds configuration, its source tree will
end up in detached head state, requiring some more magic to figure out the
proper branch.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | luci.mk | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -70,7 +70,9 @@ PKG_VERSION?=$(if $(DUMP),x,$(strip $(shell \ PKG_GITBRANCH?=$(if $(DUMP),x,$(strip $(shell \ variant="LuCI"; \ if git log -1 >/dev/null 2>/dev/null; then \ - branch="$$(git symbolic-ref --short -q HEAD 2>/dev/null)"; \ + branch="$$(git symbolic-ref --short -q HEAD 2>/dev/null || \ + git branch --remote --verbose --no-abbrev --contains 2>/dev/null | \ + sed -e 's|^.*/||; s| .*||; q')"; \ if [ "$$branch" != "master" ]; then \ variant="LuCI $$branch branch"; \ else \ |