Skip to content
  • Pete Wyckoff's avatar
    git p4 test: do not pollute /tmp · 0cf1b72a
    Pete Wyckoff authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Generating the submit template for p4 uses tempfile.mkstemp(),
    which by default puts files in /tmp.  For a test that fails,
    possibly on purpose, this is not cleaned up.  Run with TMPDIR
    pointing into the trash directory so the temp files go away
    with the test results.
    
    To do this required some other minor changes.  First, the editor
    is launched using system(editor + " " + template_file), using
    shell expansion to build the command string.  This doesn't work
    if editor has a space in it.  And is generally unwise as it's
    easy to fool the shell into doing extra work.  Exec the args
    directly, without shell expansion.
    
    Second, without shell expansion, the trick of "P4EDITOR=:" used
    in the tests doesn't work.  Use a real command, true, as the
    non-interactive editor for testing.
    
    Signed-off-by: default avatarPete Wyckoff <pw@padd.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    0cf1b72a