[PATCH] setlocalversion: fix error detectition of kernel git repository

From: xufeng
Date: Fri Jan 20 2017 - 18:24:24 EST


This patch fixed the error using 'git rev-parse --show-cdup' to check
that git is used as SCM to track the current directory. The return
value of this command is not null string when the .git directory is
not in kernel topdir.

Signed-off-by: Xufeng Wang <xufwang@xxxxxxx>
---
Âscripts/setlocalversion | 2 +-
Â1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 966dd39..7966e39 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -43,7 +43,7 @@ scm_version()
ÂÂÂÂÂfi
Â
ÂÂÂÂÂ# Check for git and a git repo.
-ÂÂÂÂif test -z "$(git rev-parse --show-cdup 2>/dev/null)" &&
+ÂÂÂÂif test -z "$(git rev-parse --show-cdup &>/dev/null)" &&
ÂÂÂÂÂÂÂÂhead=`git rev-parse --verify --short HEAD 2>/dev/null`; then
Â
ÂÂÂÂÂÂÂÂÂ# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
--Â
2.9.3