From b838d58e1a68d26dc75292ab57ec3564bd091d52 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 11 Feb 2024 10:48:11 +0100 Subject: [PATCH] rc tools git: quote $kak_buffile for add/rm Our "git add" and "git rm" default to the current file. The shell interprets globs in the filename, which can lead to surprising results, for example if it's accidentally used on a scratch buffer like *git*. --- rc/tools/git.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/tools/git.kak b/rc/tools/git.kak index bbe8d65f8..50d84cd5c 100644 --- a/rc/tools/git.kak +++ b/rc/tools/git.kak @@ -713,7 +713,7 @@ define-command -params 1.. \ add|rm) cmd="$1" shift - run_git_cmd $cmd "${@:-${kak_buffile}}" + run_git_cmd $cmd "${@:-"${kak_buffile}"}" ;; reset|checkout) run_git_cmd "$@"