Re: [PATCH v4 1/4] fetch: Protect branches checked out in all worktrees

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

 



Anders Kaseorg <andersk@xxxxxxx> writes:

>>> +	git fetch -u . HEAD:wt
>> Maybe even `test_path_exists wt/apple.t`, to verify that the
>> worktree has
>> been updated?
>
> Not here; git fetch -u never updates working trees, not even the main
> working tree.

Correct.  The "--update-head-ok" option was invented to let the user
tell Git this: I know updating the ref may make the relationship
between HEAD, the index and the working tree inconsistent, and you
will normally prevent me from doing so to save me trouble. But in
this call, I will reconcile the inconsistencies myself, so do not
worry about the issue and just update the ref.

So there is nothing to fix here.  If the user wanted to update the
working tree, taking the material that was just fetched from the
other side into account, "git pull" would have been used instead.

Thanks.



[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]

  Powered by Linux