Skip to content
  • Matthew DeVore's avatar
    exclude-promisor-objects: declare when option is allowed · 669b1d2a
    Matthew DeVore authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The --exclude-promisor-objects option causes some funny behavior in at
    least two commands: log and blame. It causes a BUG crash:
    
    	$ git log --exclude-promisor-objects
    	BUG: revision.c:2143: exclude_promisor_objects can only be used
    	when fetch_if_missing is 0
    	Aborted
    	[134]
    
    Fix this such that the option is treated like any other unknown option.
    The commands that must support it are limited, so declare in those
    commands that the flag is supported. In particular:
    
    	pack-objects
    	prune
    	rev-list
    
    The commands were found by searching for logic which parses
    --exclude-promisor-objects outside of revision.c. Extra logic outside of
    revision.c is needed because fetch_if_missing must be turned on before
    revision.c sees the option or it will BUG-crash. The above list is
    supported by the fact that no other command is introspectively invoked
    by another command passing --exclude-promisor-object.
    
    Signed-off-by: default avatarMatthew DeVore <matvore@google.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    669b1d2a