From 796bfb0a97c9c2473e052f8f9ed70cf80505d017 Mon Sep 17 00:00:00 2001 From: Herman Chen Date: Tue, 20 Aug 2019 11:22:29 +0800 Subject: [PATCH] [tools]: Update pre-commit hook Set pre-commit hook to detect changes on staged file. Change-Id: I041a82577263abcdfffc146b5aaba1d0a51def76 Signed-off-by: Herman Chen --- tools/hooks/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hooks/pre-commit b/tools/hooks/pre-commit index c00717d5..7aef3ced 100755 --- a/tools/hooks/pre-commit +++ b/tools/hooks/pre-commit @@ -11,7 +11,7 @@ cd $script_dir cd $cur_dir -git diff > $out_file +git status -s | grep "^MM " > $out_file if [ -s $out_file ] then {