Skip to content

[Bug]: Diff view fails and stops working on an edge-case #857

@shumadrid

Description

@shumadrid

Describe the bug

if you try to open a diff view of a file that's actually a nested repository (not a sub module), this plugin will throw an unhandled error, and then afterwards the diff view won't load any other files that you want to open.

A reload of the plugin is needed to reset this.

It's because only certain errors are handled in the gitShow function and others are just thrown and not being handled anywhere. (Is this intentional?)

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

Steps to reproduce

  1. Move a git repo inside your vault.
  2. Commit it a few times.
  3. Try to open it with the diff view.

Expected Behavior

No response

Addition context

I've done a bit of research on if there's a easy efficient git way to detect if any of the committed objects are actually a git repository, or other bad things like symlinks, but didn't find anything simple.

Operating system

macOS

Installation Method

None

Plugin version

2.31.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions