Commit 6faf11a
committed
Set +x in index in added-file-changed-content-and-mode
This fixes the second `gix-merge::merge tree::run_baseline` failure
in which the baseline fixture `added-file-changed-content-and-mode`
produced the wrong results when run on Windows, due to `chmod +x`
having no effect (but reporting success) when run in Git Bash.
The failure that this fixes, which is visible since the fix for
the first baseline case failure was fixed in the preceding commit,
is:
--- STDERR: gix-merge::merge tree::run_baseline ---
failed to extract 'tests\fixtures\generated-archives\tree-baseline.tar': Ignoring archive at 'tests\fixtures\generated-archives\tree-baseline.tar' as GIX_TEST_IGNORE_ARCHIVES is set.
thread 'tree::run_baseline' panicked at gix-merge\tests\merge\tree\mod.rs:93:17:
assertion failed: `(left == right)`: added-file-changed-content-and-mode-A-B-reversed: tree mismatch: We improve on executable bit handling, but loose on diff quality as we are definitely missing some tweaks
[
Conflict {
resolution: Ok(
OursModifiedTheirsModifiedThenBlobContentMerge {
merged_blob: ContentMerge {
merged_blob_id: Sha1(7ad0b902fe3f9d6857ca2e02a84f17c3eae607d6),
resolution: Conflict,
},
},
),
ours: Addition {
location: "new",
relation: None,
entry_mode: EntryMode(
33188,
),
id: Sha1(ec046db5d8b05470e472330d75f419c81ed6c9d3),
},
theirs: Addition {
location: "new",
relation: None,
entry_mode: EntryMode(
33188,
),
id: Sha1(8a1218a1024a212bb3db30becd860315f9f3ac52),
},
map: Original,
},
]
added-file-changed-content-and-mode-A-B-reversed
Diff < left / right > :
<297247d
>c5c706c
├── a:fd269b6
│ └── x.f:100644:4406528 "original\n1\n2\n3\n4\n5\n"
<└── new:100644:7ad0b90 "<<<<<<< B\noriginal\n1\n2\n3\n4\n5\n6\n=======\n1\n2\n3\n4\n5\n>>>>>>> A\n"
>└── new:100644:c3e610f "<<<<<<< A\n1\n2\n3\n4\n5\n=======\noriginal\n1\n2\n3\n4\n5\n6\n>>>>>>> B\n"
See the previous commit for a general description. The situation
here differs because the file, `new`, is newly created at the same
time as its mode is set, so it is not already in the index. While
staging it and using the same approach used in the previous commit
would work, this instead adds `--chmod=+x` to the existing
`git add` commands to stage them with the desired permissions
initially, since here those commands immediately follow the
`chmod +x` commands.
To make this work (and so it is clear), this also changes the path
argument to refer to the specific file, rather than passing `.`,
which had alredy been done in one place. These commands are (and
were) only staging a single file, so this is sufficient.
It turns out that the baseline cases fixed in the preceding commit
and here are the only causes of failure for that test, so the test
is now passing, even on Windows with `GIX_TEST_IGNORE_ARCHIVES=1`.1 parent 041bdde commit 6faf11a
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
| 533 | + | |
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
| 539 | + | |
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
| |||
0 commit comments