Skip to content

Commit

Permalink
Try to solve git: Not a valid object name HEAD^
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Jul 27, 2024
1 parent 1d58ae5 commit bc836b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/test-working-directory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ jobs:
git config user.email "[email protected]"
git config user.name "Test User"
git commit --allow-empty -m "Initial empty commit"
echo 'def hello(): return "Hello, World!"' > test.py
echo 'def hello(): return "Hello, World!"' > test.py
git add test.py
git commit -m "Add test.py file"
echo 'def hello(): return "Hello, World!"' > test.py
- name: Run Darker without working-directory (should not reformat)
uses: ./
Expand All @@ -27,6 +28,7 @@ jobs:
with:
options: --check --diff -vvv
src: test.py
revision: HEAD

- name: Check if file was not reformatted
run: |
Expand All @@ -41,6 +43,7 @@ jobs:
options: --check --diff -vvv
src: test.py
working-directory: ${{ runner.temp }}/test-repo
revision: HEAD

- name: Verify file was reformatted
run: |
Expand All @@ -60,6 +63,7 @@ jobs:
options: --check --diff -vvv
src: test.py
working-directory: ${{ runner.temp }}/non-existent-dir
revision: HEAD

- name: Check if file was not reformatted with incorrect working-directory
run: |
Expand Down

0 comments on commit bc836b7

Please sign in to comment.