mastodon-sc / mastodon-git

A plugin for Mastodon that allows to collaborate on a project via Git.
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Make git commands like "commit", etc. still work event if the user runs a "save project as" #5

Closed maarzt closed 4 months ago

maarzt commented 7 months ago

Currently if the user runs "save as" on shared project project, it is expected, that the mastodon git command gets confused an no longer works properly. This is because internally mastodon git will use the new path for saving maybe even reloading the project, but the old git repo to create the commits, etc. The consequence would be that git commands now longer produce the expected commits, or results.

Solution

Store the git repos path as a field in the class MastodonGitRepository. Replace all calls to "save" with "save as". And make sure the reload from disk also uses the git repo path. Have a unit test.

maarzt commented 4 months ago

Duplicate of #16, was fixed in #18