From 3dea9e72e280483f8f50fb90519e1eff88c64aa5 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Wed, 23 Oct 2019 15:27:18 +0100 Subject: [PATCH] updated git.sh --- .bash.d/git.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.bash.d/git.sh b/.bash.d/git.sh index 9a3ce9e5..4ad52894 100644 --- a/.bash.d/git.sh +++ b/.bash.d/git.sh @@ -566,11 +566,15 @@ revert_typechange(){ } rm_untracked(){ + if [ $# -lt 1 ]; then + echo "usage: rm_untracked " + return 1 + fi # iterate on explicit targets only # intentionally not including current directory to avoid accidentally wiping out untracked files - you must specify "rm_untracked ." if you really intend this for x in "${@:-}"; do # want splitting to separate filenames # shellcheck disable=SC2046 - rm -v $(git status --porcelain -s "$x" | awk '/^??/{print $2}') + rm -v $(git status --porcelain -s "$x" | awk '/^\?\?/{print $2}') done }