-
Notifications
You must be signed in to change notification settings - Fork 34
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
Detect dirty state of repository #14
Comments
Hey @ad-m, thanks for your suggestion. To be honest, I wasn't familiar with the At my side, I run |
I would like detect non-committed changes in local repository. To have dirty repository clone repo and change file without commiting them. Your action is about committed changes and I suggest to test for uncommitted changes. |
Hi @ad-m, sorry for the wait. I understood what you meant, great suggestion! Thanks 😀 I need to write a few unit tests for this function in order to guarantee the changes are being detected. After that, I would be willing to change to My biggest fear right now is adding a breaking change, as some people are using this action in production. Do you have any examples of testing git functionalities? My current idea is to create a bunch of test helper functions, such as: |
At first, I thought that this should be an opt-in option - check commited / uncomitted changes.
No, but I have experience with end-to-end API testing which requires a complex remote state to perform the operation. In my experience, it is worth considering several elements:
Consider following snippet of code in JavaScript: const withGit = (fn) => t => {
try{
const gitRepoPath = createGitRepo(fn);
await fn(t, gitRepoPath)
} finally {
await cleanupGit(gitRepoPath);
}
}
ava.test(withGit((t, gitRepoPath) => {
t.true(true);
})); |
What do you think about adding support detecting dirty state of repository also?
You need run:
instead of:
The text was updated successfully, but these errors were encountered: