Re: [PATCH 1/6] worktree.c: add validate_worktree()

2017-04-24 Thread Duy Nguyen
On Fri, Apr 21, 2017 at 9:16 AM, Junio C Hamano wrote: >> +int validate_worktree(const struct worktree *wt, int quiet) >> +{ >> + struct strbuf sb = STRBUF_INIT; >> + char *path; >> + int err, ret; >> + >> + if (is_main_worktree(wt)) { >> + /* >> +

Re: [PATCH 1/6] worktree.c: add validate_worktree()

2017-04-20 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > This function is later used by "worktree move" and "worktree remove" > to ensure that we have a good connection between the repository and > the worktree. For example, if a worktree is moved manually, the > worktree location recorded in

[PATCH 1/6] worktree.c: add validate_worktree()

2017-04-20 Thread Nguyễn Thái Ngọc Duy
This function is later used by "worktree move" and "worktree remove" to ensure that we have a good connection between the repository and the worktree. For example, if a worktree is moved manually, the worktree location recorded in $GIT_DIR/worktrees/.../gitdir is incorrect and we should not move

[PATCH 1/6] worktree.c: add validate_worktree()

2017-01-08 Thread Nguyễn Thái Ngọc Duy
This function is later used by "worktree move" and "worktree remove" to ensure that we have a good connection between the repository and the worktree. For example, if a worktree is moved manually, the worktree location recorded in $GIT_DIR/worktrees/.../gitdir is incorrect and we should not move