From a7cad594dfa6295fe02ff93dad1f8e789f0f8f13 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 16 Jan 2015 09:37:16 -0800 Subject: [PATCH] update Makefile to better switch to correct branch on updatedeps --- Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 92704f6e3..51754d146 100644 --- a/Makefile +++ b/Makefile @@ -22,14 +22,12 @@ testrace: generate TF_ACC= go test -race $(TEST) $(TESTARGS) updatedeps: - @# This just checks out the current branch/tag/commit again so - @# that the `git checkout -` works below. We do this to preserve our - @# location since `go get` always puts us back on the master branch. - @sh -c "git checkout `git symbolic-ref --short HEAD 2>/dev/null \ - || git rev-parse HEAD`" + $(eval REF := $(shell sh -c "\ + git symbolic-ref --short HEAD 2>/dev/null \ + || git rev-parse HEAD")) go get -u golang.org/x/tools/cmd/stringer go get -f -u -v ./... - git checkout - + git checkout $(REF) generate: go generate ./...