Skip to content

Commit

Permalink
Fix the problem with git diff command
Browse files Browse the repository at this point in the history
  • Loading branch information
Glib Smaga committed Nov 15, 2016
1 parent 1516499 commit ea30e09
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@ bench:
$(ECHO_V)$(foreach pkg,$(BENCH_PKGS),go test -bench=. -run="^$$" $(BENCH_FLAGS) $(pkg) | \
tee -a $(BENCH_FILE);)

BASELINE_BENCH_FILE=.bench/old.txt
BASELINE_BENCH_FILE = .bench/old.txt
# Git diffs can be quote noisy, and contain all sorts of special characters, this just checks
# if there is anything in the output at all, which is what we want
GIT_DIFF = $(firstword $(shell git diff master))
.PHONY: benchbase
benchbase:
$(ECHO_V)if [ -z $(IGNORE_BASELINE_CHECK) ] && [ -z "$(git diff master)" ]; then \
$(ECHO_V)if [ -z "$(IGNORE_BASELINE_CHECK)" ] && [ -n "$(GIT_DIFF)" ]; then \
echo "$(ERROR_STYLE)Can't record baseline with code changes off master." ; \
echo "Check out master and try again$(COLOR_RESET)"; \
exit 1; \
Expand Down

0 comments on commit ea30e09

Please sign in to comment.