Commit 377b1093 authored by Eugene Venter's avatar Eugene Venter

Makefile: dynamically determine remote name for upstream Mahara remote

Change-Id: Ifa5d79b4aec8a2a427bff0f702f326cd093f2145
Signed-off-by: default avatarEugene Venter <eugene@catalyst.net.nz>
parent 5e72b1f1
......@@ -15,17 +15,22 @@ ifeq (, $(branch))
branch := $(shell bash -c "git branch | grep \* | sed -e 's/ *\* *//'" )
endif
upstream_remote := $(shell git remote -v | grep gitorious.org/mahara/mahara.git | grep fetch | awk '{ print $$1 }')
ifeq (, $(upstream_remote))
upstream_remote := origin
endif
ifeq ("(no branch)", "$(branch)")
remote := origin
remote := $(upstream_remote)
else
remote := $(shell bash -c "git config --get branch.$(branch).remote" )
endif
ifeq (".", "$(remote)")
remote := origin
remote := $(upstream_remote)
endif
ifeq ("", "$(remote)")
remote := origin
remote := $(upstream_remote)
endif
commitid := $(shell bash -c "git merge-base $(remote)/master HEAD")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment