Skip to content

Commit edaaaec

Browse files
authoredJun 29, 2018
Merge pull request #7331 from nyalldawson/no_sipify_diff
Avoid prepare-commit script leaving temporary .diff files
2 parents e35ec2d + 821241e commit edaaaec

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"
@@ -96,9 +97,11 @@ if [ -s "$ASTYLEDIFF" ]; then
9697
if tty -s; then
9798
# review astyle changes
9899
colordiff <"$ASTYLEDIFF" | less -r
100+
rm "$ASTYLEDIFF"
99101
else
100102
echo "Files changed (see $ASTYLEDIFF)"
101103
fi
104+
FILES_CHANGED=1
102105
else
103106
rm "$ASTYLEDIFF"
104107
fi
@@ -131,17 +134,15 @@ if [[ -s "$SIPIFYDIFF" ]]; then
131134
if tty -s; then
132135
# review astyle changes
133136
colordiff <"$SIPIFYDIFF" | less -r
137+
rm "$SIPIFYDIFF"
134138
else
135139
echo "Files changed (see $ASTYLEDIFF)"
136140
fi
137-
exit 1
141+
FILES_CHANGED=1
138142
else
139143
rm "$SIPIFYDIFF"
140144
fi
141-
if [ -s "$ASTYLEDIFF" ]; then
142-
exit 1
143-
fi
144145

145-
exit 0
146+
exit $FILES_CHANGED
146147

147148
# vim: set ts=2 expandtab :

0 commit comments

Comments
 (0)
Please sign in to comment.