-
-
Notifications
You must be signed in to change notification settings - Fork 354
More test coverage for Repository::state::InProgress #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
inferiorhumanorgans
wants to merge
7
commits into
GitoxideLabs:main
from
inferiorhumanorgans:repo-status-additional-tests
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4124880
Add test coverage for RepositoryState::CherryPickSequence
01b7a2a
Add test coverage for RepositoryState::RevertSequence
a45bec3
Add test coverage for RepositoryState::Bisect
f03551e
Add test coverage for RepositoryState::Merge
8522202
Make rustfmt happier.
138af0e
Add test coverage for RepositoryState::ApplyMailbox
6387c5e
Update git_repository::state::InProgress docs to indicate test coverage
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file added
BIN
+9.96 KB
git-repository/tests/fixtures/generated-archives/make_bisect_repo.tar.xz
Binary file not shown.
Binary file added
BIN
+11.1 KB
git-repository/tests/fixtures/generated-archives/make_cherry_pick_sequence_repo.tar.xz
Binary file not shown.
Binary file added
BIN
+10.7 KB
git-repository/tests/fixtures/generated-archives/make_merge_repo.tar.xz
Binary file not shown.
Binary file added
BIN
+11.1 KB
git-repository/tests/fixtures/generated-archives/make_revert_sequence_repo.tar.xz
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
git init -q | ||
|
||
echo 1.main > 1 | ||
git add 1 | ||
git commit -m 1.main 1 | ||
|
||
git checkout -b other-branch | ||
echo 1.other-branch > 1 | ||
git commit -m 1.other-branch 1 | ||
# Create an mbox formatted patch and save the path | ||
patch_path=$(git format-patch main) | ||
|
||
git checkout main | ||
# Create a conflict | ||
echo 1.main.update > 1 | ||
git commit -m 1.main.update 1 | ||
|
||
# This will fail due to the merge conflict and leave us in a 'apply mbox in progress' state | ||
git am 0001-1.other-branch.patch || true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
git init -q | ||
|
||
touch 1 2 | ||
|
||
git add 1 | ||
git commit -m 1 1 | ||
|
||
git add 2 | ||
git commit -m 2 2 | ||
|
||
git bisect start |
24 changes: 24 additions & 0 deletions
24
git-repository/tests/fixtures/make_cherry_pick_sequence_repo.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
git init -q | ||
|
||
touch 1 2 3 | ||
|
||
git add 1 | ||
git commit -m 1 1 | ||
|
||
git checkout -b other-branch | ||
echo 2.other-branch > 2 | ||
git add 2 | ||
git commit -m 2.other-branch 2 | ||
git add 3 | ||
git commit -m 3 3 | ||
|
||
git checkout main | ||
echo 2.main > 2 | ||
git add 2 | ||
git commit -m 2.main 2 | ||
|
||
# This should fail and leave us in a cherry-pick + sequencer state | ||
git cherry-pick other-branch~2..other-branch || true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
git init -q | ||
|
||
echo 1.main > 1 | ||
git add 1 | ||
git commit -m 1.main 1 | ||
|
||
git checkout -b other-branch | ||
echo 1.other-branch > 1 | ||
git add 1 | ||
git commit -m 1.other-branch 1 | ||
|
||
git checkout main | ||
echo 1.main changed > 1 | ||
git commit -m 1.main\ changed 1 | ||
|
||
git merge other-branch || true |
20 changes: 20 additions & 0 deletions
20
git-repository/tests/fixtures/make_revert_sequence_repo.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
git init -q | ||
|
||
echo 1.0 > 1 | ||
git add 1 | ||
git commit -m 1.0 1 | ||
|
||
echo 1.1 > 1 | ||
git commit -m 1.1 1 | ||
|
||
echo 1.2 > 1 | ||
git commit -m 1.2 1 | ||
touch 2 | ||
git add 2 | ||
git commit -m 2 2 | ||
|
||
# This should fail and leave us in a revert + sequencer state | ||
git revert --no-commit HEAD HEAD~2 || true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue I am having with naming files with numbers while redirecting into them is that
… >1
has a different meaning than> 1
, and it's just a little too close for me to feel comfortable while reading the script.I hope you can see the point and avoid such names in the future, and I am happy to rename it for you for now as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the joys of sh. The only thing I'd add is that for this script I saved the path to the patch in
${patch_path}
but the call togit am
references the file directly.The latter should be
git am "${patch_path}"
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hint. It's adjusted in cfaf31f.