From 18496247634b54d9f8b9936bbaccfadc58bbbe82 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. --- .gitlab/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab/Makefile b/.gitlab/Makefile index 7cbfd02..18e611b 100644 --- a/.gitlab/Makefile +++ b/.gitlab/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