From d274e4e2f3e4a3ea384b6902d1228c78cfc3016d Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Fri, 21 May 2010 23:42:44 -0700 Subject: [PATCH] -Fix [FS#3836]: Git version detection would sometimes mistakenly identify a checkout as modified. --- findversion.sh | 2 ++ projects/determineversion.vbs | 8 ++++++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/findversion.sh b/findversion.sh index c792ec8..6d5f18e 100755 --- a/findversion.sh +++ b/findversion.sh @@ -87,6 +87,8 @@ if [ -d "$ROOT_DIR/.svn" ]; then 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 diff --git a/projects/determineversion.vbs b/projects/determineversion.vbs index 1c6f485..0b4f276 100755 --- a/projects/determineversion.vbs +++ b/projects/determineversion.vbs @@ -171,6 +171,14 @@ Function DetermineSVNVersion() 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 ... -- 1.7.0.4