kbuild: append -dirty for updated but uncommited changes

Compare the working copy with the last commit, instead of the index.

Signed-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
Acked-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index b7bc0f5..82e4993 100644
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -16,7 +16,7 @@
 	fi
 
 	# Are there uncommitted changes?
-	if git diff-files | read dummy; then
+	if git diff-index HEAD | read dummy; then
 		printf '%s' -dirty
 	fi
 fi