]> git.ipfire.org Git - thirdparty/git.git/commit - worktree.h
worktree.c: add find_worktree()
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Fri, 3 Jun 2016 12:19:39 +0000 (19:19 +0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 4 Jun 2016 04:58:18 +0000 (21:58 -0700)
commit6835314459794831a1b88bed56549653710e910c
treec387fabf54b670a19fcec4a02320ca5eb1197930
parent0409e0b6dc169b07c05d02e8b62389b1cc975a45
worktree.c: add find_worktree()

So far we haven't needed to identify an existing worktree from command
line. Future commands such as lock or move will need it. The current
implementation identifies worktrees by path (*). In future, the function
could learn to identify by $(basename $path) or tags...

(*) We could probably go cheaper with comparing inode number (and
probably more reliable than paths when unicode enters the game). But not
all systems have good inode that so let's stick to something simple for
now.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
worktree.c
worktree.h