Skip to content

Commit

Permalink
kbuild: fix delay in setlocalversion on readonly source
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Nico Schottelius authored and sravnborg committed Jun 14, 2009
1 parent b2d8993 commit a2bb90a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/setlocalversion
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a2bb90a

Please sign in to comment.