From 4c4048ed0a7ebb118648aae582f3a2ec921b832e Mon Sep 17 00:00:00 2001 From: Jonathan del Strother Date: Wed, 22 May 2019 16:53:17 +0100 Subject: [PATCH 1/2] scmpuff expand should escape '*' --- commands/expand/expand.go | 2 +- features/command_expand.feature | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/expand/expand.go b/commands/expand/expand.go index 1d167d1..11714e9 100644 --- a/commands/expand/expand.go +++ b/commands/expand/expand.go @@ -50,7 +50,7 @@ Takes a list of digits (1 4 5) or numeric ranges (1-5) or even both.`, var expandArgDigitMatcher = regexp.MustCompile("^[0-9]{0,4}$") var expandArgRangeMatcher = regexp.MustCompile("^([0-9]+)-([0-9]+)$") -var shellEscaper = regexp.MustCompile("([\\^()\\[\\]<>' \";\\|])") +var shellEscaper = regexp.MustCompile("([\\^()\\[\\]<>' \";\\|*])") // Process expands args and performs all substitution, etc. // diff --git a/features/command_expand.feature b/features/command_expand.feature index f2f0261..5ee0a99 100644 --- a/features/command_expand.feature +++ b/features/command_expand.feature @@ -41,6 +41,10 @@ Feature: command expansion at command line When I successfully run `scmpuff expand -- git xxx "foo bar" 1` Then the output should match /git\txxx\tfoo\\ bar\ta.txt/ + Scenario: Make sure args with globs get escaped on way back + When I successfully run `scmpuff expand -- git xxx --exclude='refs/wip/*' 1` + Then the output should contain "git xxx --exclude=refs/wip/\* a.txt" + Scenario Outline: Verify filenames with stupid characters are properly escaped Given I override the environment variables to: | variable | value | From 13bd44f1d8e886063f20f5f7c700d3cd1418da90 Mon Sep 17 00:00:00 2001 From: Jonathan del Strother Date: Thu, 23 May 2019 10:53:31 +0100 Subject: [PATCH 2/2] Fix appveyor's gem install in newer ruby --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 33f1920..5689f41 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -28,7 +28,7 @@ install: - bash --version - git --version # TODO: install ruby dependencies for integration testing - - gem install bundler --quiet --no-ri --no-rdoc + - gem install bundler --quiet --no-document - bundle install --jobs 4 --retry 3 --path vendor/bundle - bundle exec cucumber --version