From d105227b4987b9e743a72b82086b61693e00fb96 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 7 Jul 2018 08:19:44 +0200 Subject: [PATCH] vcs/gitconfig: support older gits without `stash push` Broken in 4fc2ad6 ("vcs/gitconfig: replace "stash save" with "stash push" in aliases", 2018-06-13). --- vcs/setup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vcs/setup.sh b/vcs/setup.sh index 8ea39ac..3c04f59 100755 --- a/vcs/setup.sh +++ b/vcs/setup.sh @@ -42,6 +42,12 @@ if installed git; then sed_i 's/log --patch/log -p/' gitconfig fi + if git stash push -- doesnt-exist 2>&1 \ + | grep 'usage: git stash list' > /dev/null; then + echo 'gitconfig: replacing "stash push" with "stash save"' + sed_i 's/stash push/stash save/g' gitconfig + fi + # If coloredstderr is used to color stderr then remove the workaround for # missing output to stderr. if test -n "${LD_PRELOAD:+set}" \ -- 2.43.2