Skip to content

Commit e853eef

Browse files
committed
DO NOT MERGE get more data from the test
1 parent 1d4fd0c commit e853eef

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

.github/workflows/build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@ jobs:
8080
shell: pwsh
8181
run: |
8282
cd out/build/${{ matrix.preset }}
83-
${{ github.workspace }}/azure-pipelines/end-to-end-tests.ps1 -RunArtifactsTests
83+
${{ github.workspace }}/azure-pipelines/end-to-end-tests.ps1 -RunArtifactsTests -Filter "^versions"
8484
env:
8585
VCPKG_ROOT: ${{ github.workspace }}/vcpkg-root

azure-pipelines/end-to-end-tests-dir/versions.ps1

+11-3
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,30 @@ Throw-IfFailed
9595
git -C $versionFilesPath @gitConfigOptions add -A
9696
git -C $versionFilesPath @gitConfigOptions commit -m "add octopus 1.0#1"
9797

98+
type $versionFilesPath/versions/o-/octopus.json
9899
Set-EmptyTestPort -Name octopus -Version 2.0 -PortVersion "1" -PortsRoot "$versionFilesPath/ports"
99-
$output = Run-VcpkgAndCaptureOutput @portsRedirectArgsOK x-add-version octopus
100+
type $versionFilesPath/ports/octopus/vcpkg.json
101+
type $versionFilesPath/versions/o-/octopus.json
102+
$output = Run-VcpkgAndCaptureOutput @portsRedirectArgsOK x-add-version octopus --debug
103+
type $versionFilesPath/ports/octopus/vcpkg.json
104+
type $versionFilesPath/versions/o-/octopus.json
100105
Throw-IfNotFailed
101106
if ($output -notmatch @"
102107
warning: In octopus, 2.0 is completely new version, so the "port-version" field should be removed. Remove "port-version" and try again. To skip this check, rerun with --skip-version-format-check .
103108
"@) {
104109
throw "Expected detecting present port-version when a new version is added as bad"
105110
}
106111

107-
Run-Vcpkg @portsRedirectArgsOK x-add-version octopus --skip-version-format-check
112+
Run-Vcpkg @portsRedirectArgsOK x-add-version octopus --skip-version-format-check --debug
108113
Throw-IfFailed
109114
git -C $versionFilesPath @gitConfigOptions add -A
110115
git -C $versionFilesPath @gitConfigOptions commit -m "add octopus 2.0#1"
111116

112117
Set-EmptyTestPort -Name octopus -Version 2.0 -PortVersion "3" -PortsRoot "$versionFilesPath/ports"
113-
$output = Run-VcpkgAndCaptureOutput @portsRedirectArgsOK x-add-version octopus
118+
git status
119+
type $versionFilesPath/ports/octopus/vcpkg.json
120+
type $versionFilesPath/versions/o-/octopus.json
121+
$output = Run-VcpkgAndCaptureOutput @portsRedirectArgsOK x-add-version octopus --debug
114122
Throw-IfNotFailed
115123
if ($output -notmatch @"
116124
warning: In octopus, the current "port-version" for 2.0 is 1, so the next added "port-version" should be 2, but the port declares "port-version" 3. Change "port-version" to 2 and try again. To skip this check, rerun with --skip-version-format-check .

src/vcpkg/base/git.cpp

+18-1
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,27 @@ namespace vcpkg
215215
launch_settings.working_directory.emplace(target);
216216
auto& environment = launch_settings.environment.emplace();
217217
environment.add_entry("GIT_INDEX_FILE", index_file);
218+
219+
Command cmd3(git_exe);
220+
cmd3.string_arg("-c").string_arg("core.autocrlf=false");
221+
cmd3.string_arg("status");
222+
auto out3 = cmd_execute_and_capture_output(context, cmd3, launch_settings);
223+
context.statusln(LocalizedString::from_raw(out3.value_or_exit(VCPKG_LINE_INFO).output));
224+
218225
cmd.string_arg("add");
219226
cmd.string_arg("-A");
227+
cmd.string_arg("--");
220228
cmd.string_arg(".");
221229
auto maybe_add_result = cmd_execute_and_capture_output(context, cmd, launch_settings);
222-
if (check_zero_exit_code(context, maybe_add_result, git_exe))
230+
if (auto output = check_zero_exit_code(context, maybe_add_result, git_exe))
223231
{
232+
context.statusln(LocalizedString::from_raw(*output));
233+
234+
Command cmd2(git_exe);
235+
cmd2.string_arg("-c").string_arg("core.autocrlf=false");
236+
cmd2.string_arg("status");
237+
auto out2 = cmd_execute_and_capture_output(context, cmd2, launch_settings);
238+
context.statusln(LocalizedString::from_raw(out2.value_or_exit(VCPKG_LINE_INFO).output));
224239
return true;
225240
}
226241

@@ -243,6 +258,7 @@ namespace vcpkg
243258
if (auto tree_output = check_zero_exit_code(context, maybe_write_tree_result, git_exe))
244259
{
245260
Strings::inplace_trim_end(*tree_output);
261+
context.statusln(LocalizedString::from_raw(*tree_output));
246262
return std::move(*tree_output);
247263
}
248264

@@ -264,6 +280,7 @@ namespace vcpkg
264280
auto maybe_ls_tree_result = cmd_execute_and_capture_output(context, cmd, launch_settings);
265281
if (auto ls_tree_output = check_zero_exit_code(context, maybe_ls_tree_result, git_exe))
266282
{
283+
context.statusln(LocalizedString::from_raw(*ls_tree_output));
267284
std::vector<GitLSTreeEntry> ret;
268285
const auto lines = Strings::split(*ls_tree_output, '\n');
269286
// The first line of the output is always the parent directory itself.

0 commit comments

Comments
 (0)