From 64dc587d04ad51606d7aea61a38c2a322000d40c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Peccatte?= Date: Tue, 10 May 2016 10:56:22 +0200 Subject: [PATCH] Fixes #8258: rudder-dev should not unstash something it has not stashed itself --- scripts/rudder-dev/rudder-dev | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/rudder-dev/rudder-dev b/scripts/rudder-dev/rudder-dev index d3ff0fad..fe7a5f0f 100755 --- a/scripts/rudder-dev/rudder-dev +++ b/scripts/rudder-dev/rudder-dev @@ -1146,6 +1146,10 @@ unstashed=False def unstash(): global unstashed + # only unstash things we have stashed + if not stashed: + return + # get current branch (the global variable may not be accurate in flight) this_branch = shell("git rev-parse --abbrev-ref HEAD", keep_output=True).strip() @@ -1170,9 +1174,9 @@ def unstash(): # Tell the user if some stash command happened def stash_info(): if stashed: - print("Some work in progress has been found, I stashed it before running the commands, to retrieve it use git stash pop") + print("Some work in progress has been found, " + ERROR_TPL.format("I stashed it") + " before running the commands, to retrieve it use git stash pop") if unstashed: - print("Previous work in progress has been found in the stash, I unstashed it, to hide it, use git stash save") + print("Previous work in progress has been found in the stash, " + ERROR_TPL.format("I unstashed it") + ", to hide it again, use git stash save") ###