#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "abspath.h"
#include "environment.h"
#include "gettext.h"
#include "path.h"
#include "repository.h"
#include "refs.h"
#include "setup.h"
#include "strbuf.h"
#include "worktree.h"
#include "dir.h"
#include "wt-status.h"
#include "config.h"
void free_worktree(struct worktree *worktree)
{ … }
void free_worktrees(struct worktree **worktrees)
{ … }
static void add_head_info(struct worktree *wt)
{ … }
static int is_current_worktree(struct worktree *wt)
{ … }
static struct worktree *get_main_worktree(int skip_reading_head)
{ … }
struct worktree *get_linked_worktree(const char *id,
int skip_reading_head)
{ … }
static struct worktree **get_worktrees_internal(int skip_reading_head)
{ … }
struct worktree **get_worktrees(void)
{ … }
const char *get_worktree_git_dir(const struct worktree *wt)
{ … }
static struct worktree *find_worktree_by_suffix(struct worktree **list,
const char *suffix)
{ … }
struct worktree *find_worktree(struct worktree **list,
const char *prefix,
const char *arg)
{ … }
struct worktree *find_worktree_by_path(struct worktree **list, const char *p)
{ … }
int is_main_worktree(const struct worktree *wt)
{ … }
const char *worktree_lock_reason(struct worktree *wt)
{ … }
const char *worktree_prune_reason(struct worktree *wt, timestamp_t expire)
{ … }
__attribute__((format (printf, 2, 3)))
static void strbuf_addf_gently(struct strbuf *buf, const char *fmt, ...)
{ … }
int validate_worktree(const struct worktree *wt, struct strbuf *errmsg,
unsigned flags)
{ … }
void update_worktree_location(struct worktree *wt, const char *path_)
{ … }
int is_worktree_being_rebased(const struct worktree *wt,
const char *target)
{ … }
int is_worktree_being_bisected(const struct worktree *wt,
const char *target)
{ … }
int is_shared_symref(const struct worktree *wt, const char *symref,
const char *target)
{ … }
const struct worktree *find_shared_symref(struct worktree **worktrees,
const char *symref,
const char *target)
{ … }
int submodule_uses_worktrees(const char *path)
{ … }
void strbuf_worktree_ref(const struct worktree *wt,
struct strbuf *sb,
const char *refname)
{ … }
int other_head_refs(each_ref_fn fn, void *cb_data)
{ … }
static void repair_gitfile(struct worktree *wt,
worktree_repair_fn fn, void *cb_data)
{ … }
static void repair_noop(int iserr UNUSED,
const char *path UNUSED,
const char *msg UNUSED,
void *cb_data UNUSED)
{ … }
void repair_worktrees(worktree_repair_fn fn, void *cb_data)
{ … }
static int is_main_worktree_path(const char *path)
{ … }
static char *infer_backlink(const char *gitfile)
{ … }
void repair_worktree_at_path(const char *path,
worktree_repair_fn fn, void *cb_data)
{ … }
int should_prune_worktree(const char *id, struct strbuf *reason, char **wtpath, timestamp_t expire)
{ … }
static int move_config_setting(const char *key, const char *value,
const char *from_file, const char *to_file)
{ … }
int init_worktree_config(struct repository *r)
{ … }