If the 5th step failed (for example invalid credentials, API rate limit), it failed on committing changes as all changes were committed earlier. Same applied to pushing changes, "up-to-date" response counts as an error (I don't think it should, but that's an external library).
We had a check if the working directory is dirty or not, if it was clean we simply returned without an error.
With this patch, if the working directory is dirty we try to commit, and try to push. If push error message is "already up-to-date" we can ignore the error and proceed with pull request creation.
Sadly, I couldn't find a way to check if push error is "up-to-date", so I went with the simple string comparison. It will break if they ever change the message in git, but that's very unlikely.
With Pull Request strategy, we try to:
If the 5th step failed (for example invalid credentials, API rate limit), it failed on committing changes as all changes were committed earlier. Same applied to pushing changes, "up-to-date" response counts as an error (I don't think it should, but that's an external library).
We had a check if the working directory is dirty or not, if it was clean we simply returned without an error.
With this patch, if the working directory is dirty we try to commit, and try to push. If push error message is "already up-to-date" we can ignore the error and proceed with pull request creation.
Sadly, I couldn't find a way to check if push error is "up-to-date", so I went with the simple string comparison. It will break if they ever change the message in git, but that's very unlikely.
Fixes #163