Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103209485
D15968.id49959.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15968.id49959.diff
View Options
Index: head/sys/conf/newvers.sh
===================================================================
--- head/sys/conf/newvers.sh
+++ head/sys/conf/newvers.sh
@@ -76,6 +76,35 @@
return 1
}
+git_tree_modified()
+{
+ # git diff-index lists both files that are known to have changes as
+ # well as those with metadata that does not match what is recorded in
+ # git's internal state. The latter case is indicated by an all-zero
+ # destination file hash.
+
+ local fifo vcstop_abs
+
+ fifo=$(mktemp -u)
+ mkfifo -m 600 $fifo
+ vcstop_abs=$(realpath $VCSTOP)
+ $git_cmd --work-tree=${VCSTOP} diff-index HEAD > $fifo &
+ while read smode dmode ssha dsha status file; do
+ if ! expr $dsha : '^00*$' >/dev/null; then
+ rm $fifo
+ return 0
+ fi
+ if ! $git_cmd diff --quiet -- "${vcstop_abs}/${file}"; then
+ rm $fifo
+ return 0
+ fi
+ done < $fifo
+ # No files with content differences.
+ rm $fifo
+ return 1
+}
+
+
if [ -z "${SYSDIR}" ]; then
SYSDIR=$(dirname $0)/..
fi
@@ -240,8 +269,7 @@
if [ -n "$git_b" ] ; then
git="${git}(${git_b})"
fi
- if $git_cmd --work-tree=${VCSTOP} diff-index \
- --name-only HEAD | read dummy; then
+ if git_tree_modified; then
git="${git}-dirty"
modified=true
fi
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 6:35 AM (15 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14791776
Default Alt Text
D15968.id49959.diff (1 KB)
Attached To
Mode
D15968: newvers.sh: fix git false positive -dirty tag
Attached
Detach File
Event Timeline
Log In to Comment