{"thread":{"id":"38245","subject":"\"Stash save\" exits with 0 when nothing to stash","startedAt":"2014-12-24T09:20:30Z","lastAt":"2014-12-24T09:20:30Z","messageCount":1,"participants":["Pascal Malaise"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"254076","messageId":"20141224090636.M86902@magic.fr","threadId":"38245","inReplyTo":null,"subject":"\"Stash save\" exits with 0 when nothing to stash","fromName":"Pascal Malaise","fromEmail":"malaise@magic.fr","sentAt":"2014-12-24T09:20:30Z","receivedAt":"2014-12-24T09:20:30Z","isPatch":false,"sender":{"key":"malaise@magic.fr","avatar":null},"body":"Hi,\n\nWhen calling \"git stash save\" in a clean situation (no change since last\ncommit), git-stash reports \"No local changes to save\", which is OK.\nBut it exits with code 0, despite no stash has been saved.\nIt would be better to exit with code 1 in this case.\n\nN.B. In a similar situation  \"git commit -a -m 'Test'\" reports\n> On branch master\n> nothing to commit, working directory clean\nand exits with code 1.\n\nThanks\n\ndiff -u  git-master/git-stash.sh exit1/git-stash.sh \n--- git-master/git-stash.sh\t2014-12-22 20:43:48.000000000 +0000\n+++ exit1/git-stash.sh\t2014-12-24 08:59:00.804150443 +0000\n@@ -257,7 +257,7 @@\n \tif no_changes\n \tthen\n \t\tsay \"$(gettext \"No local changes to save\")\"\n-\t\texit 0\n+\t\texit 1\n \tfi\n \ttest -f \"$GIT_DIR/logs/$ref_stash\" ||\n \t\tclear_stash || die \"$(gettext \"Cannot initialize stash\")\"\n"}]}