Skip to content
  • Elijah Newren's avatar
    update-ref: allow --no-deref with --stdin · d345e9fb
    Elijah Newren authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    If passed both --no-deref and --stdin, update-ref would error out with a
    general usage message that did not at all suggest these options were
    incompatible.  The manpage for update-ref did suggest through its
    synopsis line that --no-deref and --stdin were incompatible, but it sadly
    also incorrectly suggested that -d and --no-deref were incompatible.  So
    the help around the --no-deref option is buggy in a few ways.
    
    The --stdin option did provide a different mechanism for avoiding
    dereferencing symbolic-refs: adding a line reading
      option no-deref
    before every other directive in the input.  (Technically, if the user
    wants to do the extra work of first determining which refs they want to
    update or delete are symbolic, then they only need to put the extra
    "option no-deref" lines before the updates of those refs.  But in some
    cases, that's more work than just adding the "option no-deref" before
    every other directive.)
    
    It's easier to allow the user to just pass --no-deref along with --stdin
    in order to tell update-ref that the user doesn't want any symbolic ref
    to be dereferenced.  It also makes the update-ref documentation simpler.
    Implement that, and update the documentation to match.
    
    Signed-off-by: default avatarElijah Newren <newren@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    d345e9fb