mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Made $file in eval safe. Should not do the same for editor since then all of the GIT_EDITOR will be treated as command (flags included).
This commit is contained in:
parent
9e214781f3
commit
a9d9d3baa2
|
|
@ -117,7 +117,7 @@ add_patterns() {
|
|||
edit_file() {
|
||||
local file="${2/#~/$HOME}"
|
||||
if [ -f "$file" ]; then
|
||||
echo "Editing $1 gitignore: ($2)" && eval "$(git var GIT_EDITOR) $file"
|
||||
echo "Editing $1 gitignore: ($2)" && eval "$(git var GIT_EDITOR) $(printf '%q' "$file")"
|
||||
echo "Done."
|
||||
else
|
||||
echo "There is no $1 .gitignore yet." >&2
|
||||
|
|
|
|||
Loading…
Reference in a new issue