summaryrefslogtreecommitdiffstats
path: root/git_hooks
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre.ledru@scilab-enterprises.com>2012-05-21 18:20:11 +0200
committerVincent COUVERT <vincent.couvert@scilab.org>2012-05-22 11:16:37 +0200
commitce01d176e60b8e570a40a158a08ea0e0d0737769 (patch)
treebe9a6991aaf2a64ac08ddb14a70ab4d3fdb8fb32 /git_hooks
parente796c941941c9ef8e7435a9cde1b41881c551729 (diff)
downloadscilab-ce01d176e60b8e570a40a158a08ea0e0d0737769.zip
scilab-ce01d176e60b8e570a40a158a08ea0e0d0737769.tar.gz
Skip the indentation for deleted files
Change-Id: I68bf0c882bc835966bf3f496286d8a299e3f53a1
Diffstat (limited to 'git_hooks')
-rwxr-xr-xgit_hooks/pre-commit4
1 files changed, 3 insertions, 1 deletions
diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit
index 6776f15..f93a2de 100755
--- a/git_hooks/pre-commit
+++ b/git_hooks/pre-commit
@@ -87,8 +87,10 @@ indent() {
87 fi 87 fi
88 88
89 # loop on modified files 89 # loop on modified files
90 git diff --cached --name-only $against |while read file; 90 git diff --cached --name-status $against |while read st file;
91 do 91 do
92 # skip deleted files
93 if [ "$st" == 'D' ]; then continue; fi
92 local ext=$(expr "$file" : ".*\(\..*\)") 94 local ext=$(expr "$file" : ".*\(\..*\)")
93 case $ext in 95 case $ext in
94 .xcos|.xml) 96 .xcos|.xml)