[Cmake-commits] [cmake-commits] king committed cmCTestGIT.cxx 1.4 1.5
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue Feb 9 13:31:35 EST 2010
Update of /cvsroot/CMake/CMake/Source/CTest
In directory public:/mounts/ram/cvs-serv14562/Source/CTest
Modified Files:
cmCTestGIT.cxx
Log Message:
cmCTestGIT: Refresh index for local modifications
We use 'git diff-index' to detect local modifications after pull. On
some filesystems the work tree timestamps of a few files may be dated
after the index, making them appear as locally modified. We address the
problem by using 'git update-index --refresh' to refresh the index and
avoid false local modifications.
Index: cmCTestGIT.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestGIT.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** cmCTestGIT.cxx 21 Dec 2009 15:29:00 -0000 1.4
--- cmCTestGIT.cxx 9 Feb 2010 18:31:32 -0000 1.5
***************
*** 410,417 ****
void cmCTestGIT::LoadModifications()
{
- // Use 'git diff-index' to get modified files.
const char* git = this->CommandLineTool.c_str();
- const char* git_diff_index[] = {git, "diff-index", "-z", "HEAD", 0};
DiffParser out(this, "di-out> ");
OutputLogger err(this->Log, "di-err> ");
--- 410,423 ----
void cmCTestGIT::LoadModifications()
{
const char* git = this->CommandLineTool.c_str();
+ // Use 'git update-index' to refresh the index w.r.t. the work tree.
+ const char* git_update_index[] = {git, "update-index", "--refresh", 0};
+ OutputLogger ui_out(this->Log, "ui-out> ");
+ OutputLogger ui_err(this->Log, "ui-err> ");
+ this->RunChild(git_update_index, &ui_out, &ui_err);
+
+ // Use 'git diff-index' to get modified files.
+ const char* git_diff_index[] = {git, "diff-index", "-z", "HEAD", 0};
DiffParser out(this, "di-out> ");
OutputLogger err(this->Log, "di-err> ");
More information about the Cmake-commits
mailing list