Skip to content
  • Matthias Lederhofer's avatar
    make git barf when an alias changes environment variables · 4394efec
    Matthias Lederhofer authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Aliases changing environment variables (GIT_DIR or
    GIT_WORK_TREE) can cause problems:
    git has to use GIT_DIR to read the aliases from the config.
    After running handle_options for the alias the options of the
    alias may have changed environment variables.  Depending on
    the implementation of setenv the memory location obtained
    through getenv earlier may contain the old value or the new
    value (or even be used for something else?).  To avoid these
    problems git errors out if an alias uses any option which
    changes environment variables.
    
    Signed-off-by: default avatarMatthias Lederhofer <matled@gmx.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    4394efec