denolehov / obsidian-git

Backup your Obsidian.md vault with git
MIT License
6.15k stars 252 forks source link

[Bug]: Files in submodules cannot be opened on GitHub #592

Open Gewerd-Strauss opened 10 months ago

Gewerd-Strauss commented 10 months ago

Describe the bug

When you setup a submodule in your vault and put a note into it, executing Open file on Github & Open file history on GitHub will fail. Instead of parsing the submodule to get the correct address to built on, the file is assumed to be located in the main repo - which is obviously not the case.

Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)

No response

Steps to reproduce

  1. setup obsidian git with an existing repo and have a full sync cycle done
  2. create a submodule & push it to GH
  3. add a note in said submodule and push it to GH
  4. open the note in obsidian
  5. attempt to execute either Open file on Github or Open file history on GitHub.
  6. Notice that the run URL is pointing at nothing.

Expected Behavior

The plugin should notice if a note is in a submodule, figure out what repository the file is actually located in, get its base path and then assemble the path up to the file from there.

Addition context

No response

Operating system

Windows

Installation Method

None

Plugin version

2.22.0