Mercurial > hg > openttd
changeset 15260:012e08dc46ae draft
(svn r19895) -Fix [FS#3836]: Git version detection would sometimes mistakenly identify a checkout as modified.
author | michi_cc <michi_cc@openttd.org> |
---|---|
date | Wed, 26 May 2010 03:31:05 +0000 |
parents | 30feb3d40ea9 |
children | 7c48ec098ad1 |
files | findversion.sh projects/determineversion.vbs |
diffstat | 2 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/findversion.sh +++ b/findversion.sh @@ -87,6 +87,8 @@ 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
--- a/projects/determineversion.vbs +++ b/projects/determineversion.vbs @@ -171,6 +171,14 @@ 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 ...