summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2017-02-20 14:14:49 +0100
committerJo-Philipp Wich <jo@mein.io>2017-02-20 14:16:09 +0100
commit05c5924434786c6720e0a497215fce0337d57d82 (patch)
tree1dcf6bec3e50a274eab701be216ccc4676867693
parent0f5321d2ebe801fea77031fed221ae7b13636816 (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.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/luci.mk b/luci.mk
index 69aecaa25..26f3c94f9 100644
--- a/luci.mk
+++ b/luci.mk
@@ -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 \