#!/bin/bash

# shellcheck shell=bash

# Get repository information
bridge_repo_info() {
  if git_require_repo_root >/dev/null 2>&1; then
    root="$(git_repo_root)"
    current_path="$(git_current_path)"
    current_branch="$(git_current_branch)"
    current_commit="$(git_current_commit_short)"
    shared_root="$(git_shared_root 2>/dev/null || echo "$root")"
    
    json_object \
      "root:s=$root" \
      "current_path:s=$current_path" \
      "current_branch:s=$current_branch" \
      "current_commit:s=$current_commit" \
      "shared_root:s=$shared_root"
  else
    json_error "Not a git repository"
  fi
}
