Skip to content
  • Eric Sunshine's avatar
    t6046/t9833: fix use of "VAR=VAL cmd" with a shell function · 079b087c
    Eric Sunshine authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Unlike "FOO=bar cmd" one-shot environment variable assignments
    which exist only for the invocation of 'cmd', those assigned by
    "FOO=bar shell_func" exist within the running shell and continue to
    do so until the process exits (or are explicitly unset). It is
    unlikely that this behavior was intended by the test author.
    
    In these particular tests, the "FOO=bar shell_func" invocations are
    already in subshells, so the assignments don't last too long, don't
    appear to harm subsequent commands in the same subshells, and don't
    affect other tests in the same scripts, however, the usage is
    nevertheless misleading and poor practice, so fix the tests to assign
    and export the environment variables in the usual fashion.
    
    Signed-off-by: default avatarEric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    079b087c