When we added support for showing diffs for the STAGED root through dolt_commit_diff_ system tables, we didn't take into account that in detached head mode, there wouldn't be a valid staged root. This change detects if we're in detached head mode and replaces the staged root with the root of the detached head.
When we added support for showing diffs for the
STAGED
root throughdolt_commit_diff_
system tables, we didn't take into account that in detached head mode, there wouldn't be a valid staged root. This change detects if we're in detached head mode and replaces the staged root with the root of the detached head.