Skip to content

Commit 5d0fe32

Browse files
authored
chore: Remove X-style equality comparisons (#1028)
1 parent 75d0dbf commit 5d0fe32

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bin/git-sed

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ do_commit() {
1717
}
1818

1919
pathspec=
20-
while [ "X$1" != "X" ]; do
20+
while [ "$1" != "" ]; do
2121
case "$1" in
2222
-c|--commit)
2323
if git status --porcelain | grep .; then
@@ -33,7 +33,7 @@ actual command:
3333
}
3434
;;
3535
-f|--flags)
36-
if [ "X$2" = "X" ]; then
36+
if [ "$2" = "" ]; then
3737
usage
3838
echo "missing argument for $1"
3939
exit 1
@@ -55,11 +55,11 @@ actual command:
5555
exit 1
5656
;;
5757
*)
58-
if [ "X$search" = "X" ]; then
58+
if [ "$search" = "" ]; then
5959
search="$1"
60-
elif [ "X$replacement" = "X" ]; then
60+
elif [ "$replacement" = "" ]; then
6161
replacement="$1"
62-
elif [ "X$flags" = "X" ]; then
62+
elif [ "$flags" = "" ]; then
6363
flags="$1"
6464
else
6565
usage
@@ -79,7 +79,7 @@ case "$all" in
7979
escaped="${escaped//[/\\[}"
8080
sep="$(printf '%s' "$ascii" | tr -d "$escaped")"
8181
sep="$(printf %.1s "$sep")"
82-
if [ "X$sep" = "X" ] ; then
82+
if [ "$sep" = "" ] ; then
8383
echo 'could not find an unused character for sed separator character'
8484
exit 1
8585
fi

0 commit comments

Comments
 (0)