#pragma once

#include <git2.h>
#include <time.h>
#include <orb.h>
#include "git_list.h"

typedef struct {
  char *repo_name;
  char *repo_path;
  char *flag_ref_oid;
  char *flag_oid;
  char *flag_path;
  const char *tab_mode;
} git_repo_param_list_t;

typedef struct {
  char *oid;
  char *name;
  const char *type;
} git_repo_ref_t;

typedef struct {
  char *oid;
  char *message;
  char *summary;
  char *body;
  char *author_name;
  char *author_email;
  time_t time;
} git_repo_commit_t;

typedef struct {
  char *oid;
  char *name;
  char *content;
  size_t size;
  bool is_binary;
} git_repo_blob_t;

typedef struct {
  char *oid;
  char *name;
  char *mode;
  size_t size;
} git_repo_tree_entry_t;

typedef struct {
  char *path;
  git_repo_meta_t meta;
  git_repository *handle;
  char *flag_ref_oid;
  char *flag_oid;
  char *flag_path;
  git_repo_ref_t *ref_head;
  git_repo_ref_t *ref;
  git_repo_ref_t *ref_list;
  size_t ref_list_len;
  char *readme_oid;
  char *license_oid;
} git_repo_t;

extern const orb_module_type_t GIT_REPO_TYPE;
