Skip to content

Commit a2bb90a

Browse files
Nico Schotteliussravnborg
authored andcommitted
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]>
1 parent b2d8993 commit a2bb90a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/setlocalversion

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
3939
printf -- '-svn%s' "`git svn find-rev $head`"
4040
fi
4141

42-
# Are there uncommitted changes?
43-
git update-index --refresh --unmerged > /dev/null
42+
# Update index only on r/w media
43+
[ -w . ] && git update-index --refresh --unmerged > /dev/null
44+
45+
# Check for uncommitted changes
4446
if git diff-index --name-only HEAD | grep -v "^scripts/package" \
4547
| read dummy; then
4648
printf '%s' -dirty

0 commit comments

Comments
 (0)