Skip to content

Commit 9b12a78

Browse files
committed
Set +x in index in status_changed.sh fixture
This adds a `git update-index --chmod=+x` command in the gix-status `status_changed.sh` fixture script before the `git commit` command, so that the commit holds the same mode bits on Windows, where `chmod +x` does not take effect, as on Unix-like systems where it is generally does take effect. This change is done for the purpose of making the fixture be as was intended. But there is no corresponding change to be made to test cases that use it. The tests are asserting different things on Windows and non-Windows systems about changes in the working tree after a commit. The fixture script deliberately does not stage such changes, so for the `chmod +x` and `chmod -x` commands appearing after that in the fixture script, there is no change to the index that can correctly be made to unify the behavior across platforms. Windows doesn't support Unix-style executable permissions in the filesystem, so the state of the working tree still has to be asserted differently on Windows. Although the mode is different in the repo metadata due to this change, it still is not found to disagree with the mode on disk, since the latter information is absent. (Because the files are staged, is implicitly taken to agree with whichever of +x or -x is already recorded in the repo for them.)
1 parent eab6735 commit 9b12a78

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gix-status/tests/fixtures/status_changed.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ mkdir dir/sub-dir
1414
(cd dir/sub-dir && ln -sf ../content symlink)
1515

1616
git add -A
17+
git update-index --chmod=+x executable # For Windows.
1718
git commit -m "Commit"
1819

1920
chmod +x dir/content
@@ -23,4 +24,4 @@ echo -n "foo" > executable
2324

2425
rm empty
2526
ln -sf dir/content empty
26-
git reset
27+
git reset

0 commit comments

Comments
 (0)