From f81d846f310d3dbad1d8d8cd31b072bad540105c Mon Sep 17 00:00:00 2001 From: ducoterra Date: Mon, 1 Nov 2021 09:56:37 -0400 Subject: [PATCH] Only pop stash if changes Only pop the stash if the most recent stash commit matches the STASH name. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7cbfd02..18e611b 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ SHELL := /bin/bash IMAGE ?= $(shell cat IMAGE):$(shell cat VERSION) IMAGE_LATEST ?= $(shell cat IMAGE):latest PWD ?= $(shell pwd) +STASH ?= "common-update-stash" include .gitlab/make/docker.makefile include .gitlab/make/helm.makefile @@ -17,9 +18,9 @@ warning: .PHONY: make-update make-update: warning - @git stash + @git stash save $(STASH) -git subtree pull --prefix .gitlab git@gitlab.ducoterra.net:services/common.git main --squash - @if [-z "$(shell git stash list)"; then git stash pop; fi; + @if [ ! -z "$$(git stash list | grep -r 'stash@{0}.*common')" ]; then git stash pop; fi .PHONY: make-push make-push: warning