Re: [PATCH] Make locked paths absolute when current directory is changed

2014-07-19 Thread Duy Nguyen
On Sat, Jul 19, 2014 at 12:47 AM, Junio C Hamano wrote: >> + abspath = absolute_path(lk->filename); >> + if (strlen(abspath) >= sizeof(lk->filename)) >> + warning("locked path %s is relative when current >> directory " >> + "

Re: [PATCH] Make locked paths absolute when current directory is changed

2014-07-18 Thread Johannes Sixt
Am 18.07.2014 15:08, schrieb Nguyễn Thái Ngọc Duy: > diff --git a/lockfile.c b/lockfile.c > index 8fbcb6a..a70d107 100644 > --- a/lockfile.c > +++ b/lockfile.c > @@ -280,3 +280,19 @@ void rollback_lock_file(struct lock_file *lk) > } > lk->filename[0] = 0; > } > + > +void make_locked_pa

Re: [PATCH] Make locked paths absolute when current directory is changed

2014-07-18 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Locked paths are saved in a linked list so that if something wrong > happens, *.lock are removed. This works fine if we keep cwd the same, > which is true 99% of time except: > > - update-index and read-tree hold the lock on $GIT_DIR/index really >early, then

[PATCH] Make locked paths absolute when current directory is changed

2014-07-18 Thread Nguyễn Thái Ngọc Duy
Locked paths are saved in a linked list so that if something wrong happens, *.lock are removed. This works fine if we keep cwd the same, which is true 99% of time except: - update-index and read-tree hold the lock on $GIT_DIR/index really early, then later on may call setup_work_tree() to move