Merge topic 'ctest_update-Git-HEAD'
78b81b7
CTest: Fix ctest_update with 'HEAD' file in source tree
This commit is contained in:
commit
8106570606
|
@ -68,7 +68,7 @@ std::string cmCTestGIT::GetWorkingRevision()
|
||||||
{
|
{
|
||||||
// Run plumbing "git rev-list" to get work tree revision.
|
// Run plumbing "git rev-list" to get work tree revision.
|
||||||
const char* git = this->CommandLineTool.c_str();
|
const char* git = this->CommandLineTool.c_str();
|
||||||
const char* git_rev_list[] = {git, "rev-list", "-n", "1", "HEAD", 0};
|
const char* git_rev_list[] = {git, "rev-list", "-n", "1", "HEAD", "--", 0};
|
||||||
std::string rev;
|
std::string rev;
|
||||||
OneLineParser out(this, "rl-out> ", rev);
|
OneLineParser out(this, "rl-out> ", rev);
|
||||||
OutputLogger err(this->Log, "rl-err> ");
|
OutputLogger err(this->Log, "rl-err> ");
|
||||||
|
@ -639,7 +639,7 @@ void cmCTestGIT::LoadModifications()
|
||||||
this->RunChild(git_update_index, &ui_out, &ui_err);
|
this->RunChild(git_update_index, &ui_out, &ui_err);
|
||||||
|
|
||||||
// Use 'git diff-index' to get modified files.
|
// Use 'git diff-index' to get modified files.
|
||||||
const char* git_diff_index[] = {git, "diff-index", "-z", "HEAD", 0};
|
const char* git_diff_index[] = {git, "diff-index", "-z", "HEAD", "--", 0};
|
||||||
DiffParser out(this, "di-out> ");
|
DiffParser out(this, "di-out> ");
|
||||||
OutputLogger err(this->Log, "di-err> ");
|
OutputLogger err(this->Log, "di-err> ");
|
||||||
this->RunChild(git_diff_index, &out, &err);
|
this->RunChild(git_diff_index, &out, &err);
|
||||||
|
|
|
@ -76,6 +76,8 @@ run_child(WORKING_DIRECTORY ${TOP}/module
|
||||||
# Import initial content into the repository.
|
# Import initial content into the repository.
|
||||||
message("Importing content...")
|
message("Importing content...")
|
||||||
create_content(import)
|
create_content(import)
|
||||||
|
file(WRITE ${TOP}/import/HEAD "HEAD\n")
|
||||||
|
file(WRITE ${TOP}/import/master "master\n")
|
||||||
|
|
||||||
# Import the content into the repository.
|
# Import the content into the repository.
|
||||||
run_child(WORKING_DIRECTORY ${TOP}/import
|
run_child(WORKING_DIRECTORY ${TOP}/import
|
||||||
|
@ -157,19 +159,19 @@ update_content(user-source files_added files_removed dirs_added)
|
||||||
if(dirs_added)
|
if(dirs_added)
|
||||||
run_child(
|
run_child(
|
||||||
WORKING_DIRECTORY ${TOP}/user-source
|
WORKING_DIRECTORY ${TOP}/user-source
|
||||||
COMMAND ${GIT} add ${dirs_added}
|
COMMAND ${GIT} add -- ${dirs_added}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
run_child(
|
run_child(
|
||||||
WORKING_DIRECTORY ${TOP}/user-source
|
WORKING_DIRECTORY ${TOP}/user-source
|
||||||
COMMAND ${GIT} add ${files_added}
|
COMMAND ${GIT} add -- ${files_added}
|
||||||
)
|
)
|
||||||
run_child(
|
run_child(
|
||||||
WORKING_DIRECTORY ${TOP}/user-source
|
WORKING_DIRECTORY ${TOP}/user-source
|
||||||
COMMAND ${GIT} rm ${files_removed}
|
COMMAND ${GIT} rm -- ${files_removed}
|
||||||
)
|
)
|
||||||
run_child(WORKING_DIRECTORY ${TOP}/user-source/module
|
run_child(WORKING_DIRECTORY ${TOP}/user-source/module
|
||||||
COMMAND ${GIT} checkout master
|
COMMAND ${GIT} checkout master --
|
||||||
)
|
)
|
||||||
run_child(
|
run_child(
|
||||||
WORKING_DIRECTORY ${TOP}/user-source
|
WORKING_DIRECTORY ${TOP}/user-source
|
||||||
|
|
Loading…
Reference in New Issue