Do not update index on read only media.
Idea published by Christian Kujau <lists@nerdbynature.de>.
Cc: Nico Schottelius <nico@ikn.schottelius.org>
Cc: Christian Kujau <lists@nerdbynature.de>
                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