Skip to content
  • Junio C Hamano's avatar
    push --force-with-lease: implement logic to populate old_sha1_expect[] · 91048a95
    Junio C Hamano authored
    
    
    This plugs the push_cas_option data collected by the command line
    option parser to the transport system with a new function
    apply_push_cas(), which is called after match_push_refs() has
    already been called.
    
    At this point, we know which remote we are talking to, and what
    remote refs we are going to update, so we can fill in the details
    that may have been missing from the command line, such as
    
     (1) what abbreviated refname the user gave us matches the actual
         refname at the remote; and
    
     (2) which remote-tracking branch in our local repository to read
         the value of the object to expect at the remote.
    
    to populate the old_sha1_expect[] field of each of the remote ref.
    As stated in the documentation, the use of remote-tracking branch
    as the default is a tentative one, and we may come up with a better
    logic as we gain experience.
    
    Still nobody uses this information, which is the topic of the next
    patch.
    
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    91048a95