@@ -64,55 +64,55 @@ validate_overall_structure() {
64
64
65
65
elif [[ $STATE -eq $WAITING_EMPTY ]]; then
66
66
if [[ $LINE != " " ]]; then
67
- echo -e " missing empty line in commit message between header and body or body and footer"
67
+ echo -e " missing empty line in commit message between header and body or body and footer"
68
68
exit $ERROR_STRUCTURE
69
69
fi
70
70
STATE=" $START_TEXT "
71
71
72
72
elif [[ $STATE -eq $START_TEXT ]]; then
73
73
if [[ $LINE = " " ]]; then
74
- echo -e " double empty line is not allowed"
74
+ echo -e " double empty line is not allowed"
75
75
exit $ERROR_STRUCTURE
76
76
fi
77
77
78
78
if [[ $LINE =~ $BROKE_PATTERN ]]; then
79
- STATE=" $READING_FOOTER "
79
+ STATE=" $READING_FOOTER "
80
80
elif [[ $LINE =~ $JIRA_PATTERN ]]; then
81
- STATE=" $READING_BROKEN "
82
- GLOBAL_JIRA=${BASH_REMATCH[0]}
81
+ STATE=" $READING_BROKEN "
82
+ GLOBAL_JIRA=${BASH_REMATCH[0]}
83
83
else
84
- STATE=" $READING_BODY "
85
- GLOBAL_BODY=$GLOBAL_BODY$LINE $' \n '
84
+ STATE=" $READING_BODY "
85
+ GLOBAL_BODY=$GLOBAL_BODY$LINE $' \n '
86
86
fi
87
87
88
88
elif [[ $STATE -eq $READING_BODY ]]; then
89
89
if [[ $LINE =~ $BROKE_PATTERN ]]; then
90
- echo -e " missing empty line before broke part"
90
+ echo -e " missing empty line before broke part"
91
91
exit $ERROR_STRUCTURE
92
92
fi
93
93
94
94
if [[ $LINE =~ $JIRA_PATTERN ]]; then
95
- echo -e " missing empty line before JIRA reference"
95
+ echo -e " missing empty line before JIRA reference"
96
96
exit $ERROR_STRUCTURE
97
97
fi
98
98
99
99
if [[ $LINE = " " ]]; then
100
- STATE=$START_TEXT
100
+ STATE=$START_TEXT
101
101
else
102
- GLOBAL_BODY=$GLOBAL_BODY$LINE $' \n '
102
+ GLOBAL_BODY=$GLOBAL_BODY$LINE $' \n '
103
103
fi
104
104
105
105
elif [[ $STATE -eq $READING_BROKEN ]]; then
106
106
if [[ $LINE =~ $BROKE_PATTERN ]]; then
107
- STATE=" $READING_FOOTER "
107
+ STATE=" $READING_FOOTER "
108
108
else
109
- echo -e " only broken part could be after the JIRA reference"
109
+ echo -e " only broken part could be after the JIRA reference"
110
110
exit $ERROR_STRUCTURE
111
111
fi
112
112
113
113
elif [[ $STATE -eq $READING_FOOTER ]]; then
114
114
if [[ $LINE = " " ]]; then
115
- echo -e " no empty line allowed in broken part"
115
+ echo -e " no empty line allowed in broken part"
116
116
exit $ERROR_STRUCTURE
117
117
fi
118
118
@@ -252,7 +252,7 @@ validate_revert() {
252
252
while IFS= read -r LINE ;
253
253
do
254
254
if [[ $LINE =~ $REVERT_COMMIT_PATTERN ]]; then
255
- REVERTED_COMMIT=${BASH_REMATCH[1]}
255
+ REVERTED_COMMIT=${BASH_REMATCH[1]}
256
256
fi
257
257
done <<< " $BODY"
258
258
0 commit comments