From 648d6442d66018b499fbde86f23de4dab7cce129 Mon Sep 17 00:00:00 2001 From: 34ro Date: Tue, 21 Aug 2018 08:35:10 +0900 Subject: [PATCH] build: exec git fetch before git checkout This ensures that if a users local git state doesn't have the target commit, then we'll fetch it before ultimately checking out the commit. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 225566b0..054249d9 100644 --- a/Makefile +++ b/Makefile @@ -97,7 +97,7 @@ $(DEP_BIN): $(GLIDE_BIN): @$(call print, "Fetching glide.") go get -d $(GLIDE_PKG) - cd ${GOPATH}/src/$(GLIDE_PKG) && git checkout $(GLIDE_COMMIT) + cd ${GOPATH}/src/$(GLIDE_PKG) && ( git checkout $(GLIDE_COMMIT) || ( git fetch --all && git checkout $(GLIDE_COMMIT) ) ) $(GOINSTALL) $(GLIDE_PKG) $(GOVERALLS_BIN): @@ -119,7 +119,7 @@ $(BTCD_DIR): btcd: $(GLIDE_BIN) $(BTCD_DIR) @$(call print, "Compiling btcd dependencies.") - cd $(BTCD_DIR) && git checkout $(BTCD_COMMIT) && glide install + cd $(BTCD_DIR) && ( git checkout $(BTCD_COMMIT) || ( git fetch --all && git checkout $(BTCD_COMMIT) ) ) && glide install @$(call print, "Installing btcd and btcctl.") $(GOINSTALL) $(BTCD_PKG) $(GOINSTALL) $(BTCD_PKG)/cmd/btcctl