Merge branch 'nd/wildmatch-double-asterisk'
authorJunio C Hamano <gitster@pobox.com>
Tue, 13 Nov 2018 13:37:19 +0000 (22:37 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Nov 2018 13:37:19 +0000 (22:37 +0900)
A pattern with '**' that does not have a slash on either side used
to be an invalid one, but the code now treats such double-asterisks
the same way as two normal asterisks that happen to be adjacent to
each other.

* nd/wildmatch-double-asterisk:
wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

1  2 
Documentation/gitignore.txt
t/t3070-wildmatch.sh
index d107daaffd4e84921c47951cf743d1eace11c525,32b227942f808cf5e1a1f6006c3fd278d78e470d..1c94f08ff4dd9af173c659fb0b536f6a71a1c252
@@@ -7,7 -7,7 +7,7 @@@ gitignore - Specifies intentionally unt
  
  SYNOPSIS
  --------
 -$HOME/.config/git/ignore, $GIT_DIR/info/exclude, .gitignore
 +$XDG_CONFIG_HOME/git/ignore, $GIT_DIR/info/exclude, .gitignore
  
  DESCRIPTION
  -----------
@@@ -129,7 -129,8 +129,8 @@@ full pathname may have special meaning
     matches zero or more directories. For example, "`a/**/b`"
     matches "`a/b`", "`a/x/b`", "`a/x/y/b`" and so on.
  
-  - Other consecutive asterisks are considered invalid.
+  - Other consecutive asterisks are considered regular asterisks and
+    will match according to the previous rules.
  
  NOTES
  -----
diff --combined t/t3070-wildmatch.sh
index 46aca0af102e863f8c46f160d3f2022aee5ba29e,7ba5d35eb270f2b3ef1e6586e545c1aeef485ee2..891d4d7cb9f1a7d1a8caa75f30e6d4eb4ea0df14
@@@ -101,7 -101,8 +101,7 @@@ match_with_ls_files() 
  
        match_stdout_stderr_cmp="
                tr -d '\0' <actual.raw >actual &&
 -              >expect.err &&
 -              test_cmp expect.err actual.err &&
 +              test_must_be_empty actual.err &&
                test_cmp expect actual"
  
        if test "$match_expect" = 'E'
@@@ -237,7 -238,7 +237,7 @@@ match 0 0 0 0 foobar 'foo\*bar
  match 1 1 1 1 'f\oo' 'f\\oo'
  match 1 1 1 1 ball '*[al]?'
  match 0 0 0 0 ten '[ten]'
- match 0 0 1 1 ten '**[!te]'
+ match 1 1 1 1 ten '**[!te]'
  match 0 0 0 0 ten '**[!ten]'
  match 1 1 1 1 ten 't[a-g]n'
  match 0 0 0 0 ten 't[!a-g]n'
@@@ -253,7 -254,7 +253,7 @@@ match 1 1 1 1 ']' ']
  # Extended slash-matching features
  match 0 0 1 1 'foo/baz/bar' 'foo*bar'
  match 0 0 1 1 'foo/baz/bar' 'foo**bar'
- match 0 0 1 1 'foobazbar' 'foo**bar'
+ match 1 1 1 1 'foobazbar' 'foo**bar'
  match 1 1 1 1 'foo/baz/bar' 'foo/**/bar'
  match 1 1 0 0 'foo/baz/bar' 'foo/**/**/bar'
  match 1 1 1 1 'foo/b/a/z/bar' 'foo/**/bar'