Skip to content

Commit a7aec56

Browse files
committedJun 29, 2018
Avoid prepare-commit script leaving temporary .diff files
(cherry-picked from 821241e)
1 parent c409d5a commit a7aec56

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎scripts/prepare-commit.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ fi
5959

6060
if [[ -n "$QGIS_CHECK_SPELLING" && -x "${TOPLEVEL}"/scripts/spell_check/check_spelling.sh ]]; then "${TOPLEVEL}"/scripts/spell_check/check_spelling.sh "$MODIFIED"; fi
6161

62+
FILES_CHANGED=0
6263

6364
# save original changes
6465
REV=$(git log -n1 --pretty=%H)
65-
git diff >sha-"$REV".diff
66+
#git diff >sha-"$REV".diff
6667

6768
ASTYLEDIFF=astyle.$REV.diff
6869
true > "$ASTYLEDIFF"
@@ -101,9 +102,11 @@ if [ -s "$ASTYLEDIFF" ]; then
101102
if tty -s; then
102103
# review astyle changes
103104
colordiff <"$ASTYLEDIFF" | less -r
105+
rm "$ASTYLEDIFF"
104106
else
105107
echo "Files changed (see $ASTYLEDIFF)"
106108
fi
109+
FILES_CHANGED=1
107110
else
108111
rm "$ASTYLEDIFF"
109112
fi
@@ -136,17 +139,15 @@ if [[ -s "$SIPIFYDIFF" ]]; then
136139
if tty -s; then
137140
# review astyle changes
138141
colordiff <"$SIPIFYDIFF" | less -r
142+
rm "$SIPIFYDIFF"
139143
else
140144
echo "Files changed (see $ASTYLEDIFF)"
141145
fi
142-
exit 1
146+
FILES_CHANGED=1
143147
else
144148
rm "$SIPIFYDIFF"
145149
fi
146-
if [ -s "$ASTYLEDIFF" ]; then
147-
exit 1
148-
fi
149150

150-
exit 0
151+
exit $FILES_CHANGED
151152

152153
# vim: set ts=2 expandtab :

0 commit comments

Comments
 (0)
Please sign in to comment.