Skip to content

Commit fe734b7

Browse files
authored
fix : diff view stops working for non file objects (#858)
1 parent 18e966e commit fe734b7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ui/diff/splitDiffView.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,13 @@ export default class SplitDiffView extends ItemView {
173173
if (
174174
error.message.includes("does not exist") ||
175175
error.message.includes("unknown revision or path") ||
176-
error.message.includes("exists on disk, but not in")
176+
error.message.includes("exists on disk, but not in") ||
177+
error.message.includes("fatal: bad object")
177178
) {
179+
// Occurs when trying to run diff with an object that's actually a nested respository
180+
if (error.message.includes("fatal: bad object")) {
181+
this.plugin.displayError(error.message);
182+
}
178183
// If the file does not exist in the commit, return an empty string
179184
return "";
180185
}

0 commit comments

Comments
 (0)