[PATCH 05/15] connect_work_tree_and_git_dir: safely create leading directories

2017-02-23 Thread Stefan Beller
In a later patch we'll use connect_work_tree_and_git_dir when the directory for the gitlink file doesn't exist yet. This patch makes connect_work_tree_and_git_dir safe to use for both cases of either the git dir or the working dir missing. To do so, we need to call safe_create_leading_directories[

Re: [PATCH 05/15] connect_work_tree_and_git_dir: safely create leading directories

2017-02-16 Thread Junio C Hamano
Stefan Beller writes: >> The above does somewhat more than advertised and was a bit hard to >> grok. Initially I thought the reason why pathdup()s were delayed >> was perhaps because you pathdup() something potentially different >> from the given parameter to the function (i.e. new code before >

Re: [PATCH 05/15] connect_work_tree_and_git_dir: safely create leading directories

2017-02-16 Thread Stefan Beller
On Thu, Feb 16, 2017 at 12:54 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> In a later patch we'll use connect_work_tree_and_git_dir when the >> directory for the gitlink file doesn't exist yet. Safely create >> the directory first. >> >> One of the two users of 'connect_work_tree_and_gi

Re: [PATCH 05/15] connect_work_tree_and_git_dir: safely create leading directories

2017-02-16 Thread Junio C Hamano
Stefan Beller writes: > In a later patch we'll use connect_work_tree_and_git_dir when the > directory for the gitlink file doesn't exist yet. Safely create > the directory first. > > One of the two users of 'connect_work_tree_and_git_dir' already checked > for the directory being there, so we can

[PATCH 05/15] connect_work_tree_and_git_dir: safely create leading directories

2017-02-15 Thread Stefan Beller
In a later patch we'll use connect_work_tree_and_git_dir when the directory for the gitlink file doesn't exist yet. Safely create the directory first. One of the two users of 'connect_work_tree_and_git_dir' already checked for the directory being there, so we can loose that check. Signed-off-by: