worktree: add top-level worktree.c

worktree.c contains functions to work with and get information from
worktrees.  This introduction moves functions related to worktrees
from branch.c into worktree.c

Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael Rappazzo
2015-10-02 07:55:31 -04:00
committed by Junio C Hamano
parent 8d530c4d64
commit ac6c561b59
6 changed files with 97 additions and 87 deletions

12
worktree.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef WORKTREE_H
#define WORKTREE_H
/*
* Check if a per-worktree symref points to a ref in the main worktree
* or any linked worktree, and return the path to the exising worktree
* if it is. Returns NULL if there is no existing ref. The caller is
* responsible for freeing the returned path.
*/
extern char *find_shared_symref(const char *symref, const char *target);
#endif