-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from readdle/fix-switch-pre-post-s7
Fix switch between pre-s7 and s7 commits in repo.
- Loading branch information
Showing
7 changed files
with
173 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
45 changes: 45 additions & 0 deletions
45
system7-tests/integration/case-switchBetweenPreS7AndS7Commits.sh
This file contains 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,45 @@ | ||
#!/bin/sh | ||
|
||
git clone github/rd2 pastey/rd2 | ||
|
||
cd pastey/rd2 | ||
|
||
COMMIT_WITHOUT_S7="$(git rev-parse HEAD)" | ||
|
||
assert s7 init | ||
assert git add . | ||
assert git commit -m "\"init s7\"" | ||
|
||
assert s7 add --stage Dependencies/RDPDFKit '"$S7_ROOT/github/RDPDFKit"' | ||
|
||
git commit -m"add pdfkit subrepo" | ||
|
||
COMMIT_WITH_S7="$(git rev-parse HEAD)" | ||
|
||
# switch back to pre-s7 times | ||
git checkout "$COMMIT_WITHOUT_S7" | ||
|
||
assert test -z "$(git status --porcelain)" | ||
grep -q "s7" .gitignore | ||
assert test 1 -eq $? | ||
assert test ! -f .git/hooks/post-checkout | ||
|
||
# to s7 again | ||
git checkout "$COMMIT_WITH_S7" | ||
|
||
assert test -z "$(git status --porcelain)" | ||
grep -q "s7" .gitignore | ||
assert test 0 -eq $? | ||
grep "s7" .git/hooks/post-checkout | ||
assert test 0 -eq $? | ||
# bootstrap init must not get stuck on back and forth switches | ||
grep "init" .git/hooks/post-checkout | ||
assert test 1 -eq $? | ||
|
||
# and to pre-s7 one more time | ||
git checkout "$COMMIT_WITHOUT_S7" | ||
|
||
assert test -z "$(git status --porcelain)" | ||
grep -q "s7" .gitignore | ||
assert test 1 -eq $? | ||
assert test ! -f .git/hooks/post-checkout |
58 changes: 58 additions & 0 deletions
58
system7-tests/integration/case-switchBetweenPreS7AndS7CommitsMixedWithGitLFS.sh
This file contains 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,58 @@ | ||
#!/bin/sh | ||
|
||
git clone github/rd2 pastey/rd2 | ||
|
||
cd pastey/rd2 | ||
|
||
COMMIT_WITHOUT_S7="$(git rev-parse HEAD)" | ||
|
||
cat <<EOT > .git/hooks/post-checkout | ||
#!/bin/sh | ||
echo "Git LFS was here" | ||
EOT | ||
|
||
assert s7 init | ||
assert git add . | ||
assert git commit -m "\"init s7\"" | ||
|
||
assert s7 add --stage Dependencies/RDPDFKit '"$S7_ROOT/github/RDPDFKit"' | ||
|
||
git commit -m"add pdfkit subrepo" | ||
|
||
COMMIT_WITH_S7="$(git rev-parse HEAD)" | ||
|
||
# switch back to pre-s7 times | ||
git checkout "$COMMIT_WITHOUT_S7" | ||
|
||
assert test -z "$(git status --porcelain)" | ||
grep -q "s7" .gitignore | ||
assert test 1 -eq $? | ||
grep -q -i "lfs" .git/hooks/post-checkout | ||
assert test 0 -eq $? | ||
grep "s7" .git/hooks/post-checkout | ||
assert test 1 -eq $? | ||
|
||
# to s7 again | ||
git checkout "$COMMIT_WITH_S7" | ||
|
||
assert test -z "$(git status --porcelain)" | ||
grep -q "s7" .gitignore | ||
assert test 0 -eq $? | ||
grep -q -i "lfs" .git/hooks/post-checkout | ||
assert test 0 -eq $? | ||
grep "s7" .git/hooks/post-checkout | ||
assert test 0 -eq $? | ||
# bootstrap init must not get stuck on back and forth switches | ||
grep "init" .git/hooks/post-checkout | ||
assert test 1 -eq $? | ||
|
||
# and to pre-s7 one more time | ||
git checkout "$COMMIT_WITHOUT_S7" | ||
|
||
assert test -z "$(git status --porcelain)" | ||
grep -q "s7" .gitignore | ||
assert test 1 -eq $? | ||
grep -q -i "lfs" .git/hooks/post-checkout | ||
assert test 0 -eq $? | ||
grep "s7" .git/hooks/post-checkout | ||
assert test 1 -eq $? |
This file contains 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 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 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 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