Change in osmo-ttcn3-hacks[master]: deps/Makefile: fix checkout logic for branches

osmith gerrit-no-reply at lists.osmocom.org
Mon Apr 19 10:35:59 UTC 2021


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23796 )


Change subject: deps/Makefile: fix checkout logic for branches
......................................................................

deps/Makefile: fix checkout logic for branches

Checkout origin/$branch instead of $branch. Otherwise git will just use
the local version of branch and stay at the same commit.

Note that Ia846863eff1734eca469257b9a8d5e653a45e835 changes the lines
which still have "master" to the commit. Fixing this is still useful
however, if a branch name is used in local testing.

Change-Id: If6bd440598d375a9947cb3a4fd88ae5809756e0e
---
M deps/Makefile
1 file changed, 9 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/96/23796/1

diff --git a/deps/Makefile b/deps/Makefile
index c63dca7..171ca36 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -151,7 +151,15 @@
 	cd $(1) && git remote set-url origin $(2)/$(1) && git fetch
 endif
 ifneq ($$($(1)_HEAD),$($(1)_commit))
-	cd $(1) && git fetch && git checkout -q -f "$($(1)_commit)"
+	cd $(1) && \
+		git fetch && \
+		if git rev-parse "origin/$($(1)_commit)" 2>/dev/null; then \
+			set -x && \
+			git checkout -q -f "origin/$($(1)_commit)"; \
+		else \
+			set -x && \
+			git checkout -q -f "$($(1)_commit)"; \
+		fi
 endif
 endif
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23796
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If6bd440598d375a9947cb3a4fd88ae5809756e0e
Gerrit-Change-Number: 23796
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210419/7d4fe910/attachment.htm>


More information about the gerrit-log mailing list