dynamist / subgit

Sub-git repo handler
Apache License 2.0
0 stars 0 forks source link

Cornercase with _check_remote #64

Open Grokzen opened 1 year ago

Grokzen commented 1 year ago

When running this method def _check_remote(self, repo): on a repo with a specific set of setup it will trigger false-positive case.

So if we have a cloned repo say pykwalify, and we have it around for some time. Then on the remote a feature branch named f/foobar was removed due to it being merged in github in a PR, then we will get a diff the next time the _check_remote method is called because the logic is written so that if there is a mismatch between the local and remote we assume something is wrong. And we treat this diff as the same as the repo would have a commit ahead of the remote or some uncommitted file locally.

The fix is probably to make the checks much more specific in the method and have corner cases where it should not be treated as a dirty repo.

The one possible exception to this is that in the case i manually create a branch locally that is not pushed to remote it could be seen as dirty but in a legit way counter to the above text