Re: [PATCHv7 4/6] worktree: have a function to check if worktrees are in use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 9, 2016 at 4:00 AM, Duy Nguyen <pclouds@xxxxxxxxx> wrote:

> int submodule_uses_worktrees(const char *path)
> {
>         struct strbuf path = STRBUF_INIT;
>         DIR *dir;
>         struct dirent *d;
>         int ret = 0;
>
>         strbuf_addf(&path, "%s/worktrees", path);
>         dir = opendir(path.buf);
>         strbuf_release(&path);
>
>         if (!dir)
>                 return 0;

The submodule may be one of the linked worktrees, which would be
caught if we use the code as I sent it out?

If this is one of the linked worktrees, we'd rather check if a file
"commondir" or "gitdir" exists?

I ask that because I would not know how to relocate such a linked
worktree gitdir?



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]