mirror of
https://github.com/git/git.git
synced 2026-03-26 16:40:14 +01:00
Merge branch 've/userdiff-bash'
The userdiff pattern learned to identify the function definition in POSIX shells and bash. * ve/userdiff-bash: userdiff: support Bash
This commit is contained in:
@@ -27,6 +27,7 @@ test_expect_success 'setup' '
|
||||
|
||||
diffpatterns="
|
||||
ada
|
||||
bash
|
||||
bibtex
|
||||
cpp
|
||||
csharp
|
||||
|
||||
4
t/t4018/bash-arithmetic-function
Normal file
4
t/t4018/bash-arithmetic-function
Normal file
@@ -0,0 +1,4 @@
|
||||
RIGHT() ((
|
||||
|
||||
ChangeMe = "$x" + "$y"
|
||||
))
|
||||
6
t/t4018/bash-bashism-style-compact
Normal file
6
t/t4018/bash-bashism-style-compact
Normal file
@@ -0,0 +1,6 @@
|
||||
function RIGHT {
|
||||
function InvalidSyntax{
|
||||
:
|
||||
echo 'ChangeMe'
|
||||
}
|
||||
}
|
||||
4
t/t4018/bash-bashism-style-function
Normal file
4
t/t4018/bash-bashism-style-function
Normal file
@@ -0,0 +1,4 @@
|
||||
function RIGHT {
|
||||
:
|
||||
echo 'ChangeMe'
|
||||
}
|
||||
4
t/t4018/bash-bashism-style-whitespace
Normal file
4
t/t4018/bash-bashism-style-whitespace
Normal file
@@ -0,0 +1,4 @@
|
||||
function RIGHT ( ) {
|
||||
|
||||
ChangeMe
|
||||
}
|
||||
4
t/t4018/bash-conditional-function
Normal file
4
t/t4018/bash-conditional-function
Normal file
@@ -0,0 +1,4 @@
|
||||
RIGHT() [[ \
|
||||
|
||||
"$a" > "$ChangeMe"
|
||||
]]
|
||||
6
t/t4018/bash-missing-parentheses
Normal file
6
t/t4018/bash-missing-parentheses
Normal file
@@ -0,0 +1,6 @@
|
||||
function RIGHT {
|
||||
functionInvalidSyntax {
|
||||
:
|
||||
echo 'ChangeMe'
|
||||
}
|
||||
}
|
||||
4
t/t4018/bash-mixed-style-compact
Normal file
4
t/t4018/bash-mixed-style-compact
Normal file
@@ -0,0 +1,4 @@
|
||||
function RIGHT(){
|
||||
:
|
||||
echo 'ChangeMe'
|
||||
}
|
||||
4
t/t4018/bash-mixed-style-function
Normal file
4
t/t4018/bash-mixed-style-function
Normal file
@@ -0,0 +1,4 @@
|
||||
function RIGHT() {
|
||||
|
||||
ChangeMe
|
||||
}
|
||||
6
t/t4018/bash-nested-functions
Normal file
6
t/t4018/bash-nested-functions
Normal file
@@ -0,0 +1,6 @@
|
||||
outer() {
|
||||
RIGHT() {
|
||||
:
|
||||
echo 'ChangeMe'
|
||||
}
|
||||
}
|
||||
4
t/t4018/bash-other-characters
Normal file
4
t/t4018/bash-other-characters
Normal file
@@ -0,0 +1,4 @@
|
||||
_RIGHT_0n() {
|
||||
|
||||
ChangeMe
|
||||
}
|
||||
4
t/t4018/bash-posix-style-compact
Normal file
4
t/t4018/bash-posix-style-compact
Normal file
@@ -0,0 +1,4 @@
|
||||
RIGHT(){
|
||||
|
||||
ChangeMe
|
||||
}
|
||||
4
t/t4018/bash-posix-style-function
Normal file
4
t/t4018/bash-posix-style-function
Normal file
@@ -0,0 +1,4 @@
|
||||
RIGHT() {
|
||||
|
||||
ChangeMe
|
||||
}
|
||||
4
t/t4018/bash-posix-style-whitespace
Normal file
4
t/t4018/bash-posix-style-whitespace
Normal file
@@ -0,0 +1,4 @@
|
||||
RIGHT ( ) {
|
||||
|
||||
ChangeMe
|
||||
}
|
||||
4
t/t4018/bash-subshell-function
Normal file
4
t/t4018/bash-subshell-function
Normal file
@@ -0,0 +1,4 @@
|
||||
RIGHT() (
|
||||
|
||||
ChangeMe=2
|
||||
)
|
||||
4
t/t4018/bash-trailing-comment
Normal file
4
t/t4018/bash-trailing-comment
Normal file
@@ -0,0 +1,4 @@
|
||||
RIGHT() { # Comment
|
||||
|
||||
ChangeMe
|
||||
}
|
||||
Reference in New Issue
Block a user