File tree Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change 14
14
# #
15
15
# ##########################################################################
16
16
17
+ TOPLEVEL=$( git rev-parse --show-toplevel)
17
18
18
- PATH=$( git rev-parse --show-toplevel) /scripts:$PATH
19
+ PATH=$TOPLEVEL /scripts:$PATH
20
+
21
+ cd $TOPLEVEL
19
22
20
23
if ! type -p astyle.sh > /dev/null; then
21
24
echo astyle.sh not found
37
40
set -e
38
41
39
42
# determine changed files
40
- if [ -d .svn ]; then
41
- MODIFIED=$( svn status | sed -ne " s/^[MA] *//p" )
42
- elif [ -d .git ]; then
43
- MODIFIED=$( git status --porcelain| sed -ne " s/^ *[MA] *//p" | sort -u)
44
- else
45
- echo No working copy
46
- exit 1
47
- fi
43
+ MODIFIED=$( git status --porcelain| sed -ne " s/^ *[MA] *//p" | sort -u)
48
44
49
45
if [ -z " $MODIFIED " ]; then
50
46
echo nothing was modified
51
47
exit 0
52
48
fi
53
49
54
50
# save original changes
55
- if [ -d .svn ]; then
56
- REV=r$( svn info | sed -ne " s/Revision: //p" )
57
- svn diff > rev-$REV .diff
58
- elif [ -d .git ]; then
59
- REV=$( git log -n1 --pretty=%H)
60
- git diff > sha-$REV .diff
61
- fi
51
+ REV=$( git log -n1 --pretty=%H)
52
+ git diff > sha-$REV .diff
62
53
63
54
ASTYLEDIFF=astyle.$REV .diff
64
55
> $ASTYLEDIFF
You can’t perform that action at this time.
0 commit comments