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.
This commit is contained in:
34ro 2018-08-21 08:35:10 +09:00 committed by Olaoluwa Osuntokun
parent 21841c9f6b
commit 648d6442d6

@ -97,7 +97,7 @@ $(DEP_BIN):
$(GLIDE_BIN): $(GLIDE_BIN):
@$(call print, "Fetching glide.") @$(call print, "Fetching glide.")
go get -d $(GLIDE_PKG) 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) $(GOINSTALL) $(GLIDE_PKG)
$(GOVERALLS_BIN): $(GOVERALLS_BIN):
@ -119,7 +119,7 @@ $(BTCD_DIR):
btcd: $(GLIDE_BIN) $(BTCD_DIR) btcd: $(GLIDE_BIN) $(BTCD_DIR)
@$(call print, "Compiling btcd dependencies.") @$(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.") @$(call print, "Installing btcd and btcctl.")
$(GOINSTALL) $(BTCD_PKG) $(GOINSTALL) $(BTCD_PKG)
$(GOINSTALL) $(BTCD_PKG)/cmd/btcctl $(GOINSTALL) $(BTCD_PKG)/cmd/btcctl