Changeset - r15250:61ec821d955c
[Not reviewed]
master
0 2 0
michi_cc - 14 years ago 2010-05-26 03:31:05
michi_cc@openttd.org
(svn r19895) -Fix [FS#3836]: Git version detection would sometimes mistakenly identify a checkout as modified.
2 files changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
findversion.sh
Show inline comments
 
@@ -84,12 +84,14 @@ if [ -d "$ROOT_DIR/.svn" ]; then
 
		REV=$TAG
 
	else
 
		REV="r$REV_NR"
 
	fi
 
elif [ -d "$ROOT_DIR/.git" ]; then
 
	# We are a git checkout
 
	# Refresh the index to make sure file stat info is in sync, then look for modifications
 
	git update-index --refresh >/dev/null
 
	if [ -n "`git diff-index HEAD \"$SRC_DIR\"`" ]; then
 
		MODIFIED="2"
 
	fi
 
	HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null`
 
	REV="g`echo $HASH | cut -c1-8`"
 
	BRANCH=`git branch|grep '[*]' | sed 's@\* @@;s@^master$@@'`
projects/determineversion.vbs
Show inline comments
 
@@ -168,12 +168,20 @@ Function DetermineSVNVersion()
 
			Do While oExec.Status = 0
 
			Loop
 

	
 
			If oExec.ExitCode = 0 Then
 
				hash = oExec.StdOut.ReadLine()
 
				version = "g" & Mid(hash, 1, 8)
 
				' Make sure index is in sync with disk
 
				Set oExec = WshShell.Exec("git update-index --refresh")
 
				If Err.Number = 0 Then
 
					' Wait till the application is finished ...
 
					Do While oExec.Status = 0
 
						WScript.Sleep 10
 
					Loop
 
				End If
 
				Set oExec = WshShell.Exec("git diff-index --exit-code --quiet HEAD ../src")
 
				If Err.Number = 0 Then
 
					' Wait till the application is finished ...
 
					Do While oExec.Status = 0
 
					Loop
 

	
0 comments (0 inline, 0 general)