laforge submitted this change.

View Change

Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified
deps/update: don't fetch repos where COMMIT exists

Instead of unconditionally fetching each git repository, check if the
commit we want to checkout already exists in the git repository. If that
is the case, then don't fetch it.

Related: OS#6572
Change-Id: I342957668892e7d29666fada82362cb4a6c7aac5
---
M deps/update.sh
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/deps/update.sh b/deps/update.sh
index ad12bcb..c0a3dab 100755
--- a/deps/update.sh
+++ b/deps/update.sh
@@ -3,7 +3,10 @@
COMMIT="$2"

cd "$DIR"
-git fetch
+
+if ! git cat-file -e "$COMMIT"; then
+ git fetch
+fi

if git rev-parse "origin/$COMMIT" 2>/dev/null; then
set -x

To view, visit change 38220. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I342957668892e7d29666fada82362cb4a6c7aac5
Gerrit-Change-Number: 38220
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>