mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
kbuild: fix delay in setlocalversion on readonly source
Do not update index on read only media. Idea published by Christian Kujau <[email protected]>. Cc: Nico Schottelius <[email protected]> Cc: Christian Kujau <[email protected]>
This commit is contained in:
committed by
Sam Ravnborg
parent
b2d8993026
commit
a2bb90a08c
@@ -39,8 +39,10 @@ if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
|
||||
printf -- '-svn%s' "`git svn find-rev $head`"
|
||||
fi
|
||||
|
||||
# Are there uncommitted changes?
|
||||
git update-index --refresh --unmerged > /dev/null
|
||||
# Update index only on r/w media
|
||||
[ -w . ] && git update-index --refresh --unmerged > /dev/null
|
||||
|
||||
# Check for uncommitted changes
|
||||
if git diff-index --name-only HEAD | grep -v "^scripts/package" \
|
||||
| read dummy; then
|
||||
printf '%s' -dirty
|
||||
|
||||
Reference in New Issue
Block a user