Re: [PATCH] git-new-workdir: Don't fail if the target directory is empty
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 21, 2014, 17:33 UTC
- Message-ID
- <xmqqegsw1msr.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1416582517.23953.18.camel@mad-scientist.net>
Paul Smith <paul@mad-scientist.net> writes:
Show 8 quoted lines
>> Why these changes? I thought you are making sure $cleandir is >> absolute so that you do not have to do this and can just "cd" into >> the new working tree, the same way the user would do once it is set >> up. > > I made cleandir absolute mainly because you asked me to :-). I didn't > realize that the implication behind that request was that I'd put back > the original "cd" as well.
This is about not changing unnecessarily the original that has been battle-tested and keeping the result resistant to future mistakes (i.e. somebody going elsewhere without realizing a relative cleandir will cause problems). Once $cleandir is fixed, there no longer is a good reason to change how HEAD is pointed in the $new_workdir or its working tree populated; the change in the earlier round in that area was necessary when $cleandir was not absolute, but not anymore.