blob: fa1bba1dd93614c8ad5c7f4a37c5b612440fd0eb [file] [log] [blame]
Luke Diamand9afbb2d2015-05-19 23:23:16 +01001#!/bin/sh
2
3test_description='git p4 handling of EDITOR'
4
5. ./lib-git-p4.sh
6
7test_expect_success 'start p4d' '
8 start_p4d
9'
10
11test_expect_success 'init depot' '
12 (
13 cd "$cli" &&
14 echo file1 >file1 &&
15 p4 add file1 &&
16 p4 submit -d "file1"
17 )
18'
19
20# Check that the P4EDITOR argument can be given command-line
21# options, which git-p4 will then pass through to the shell.
Luke Diamand2dade7a2015-05-19 23:23:17 +010022test_expect_success 'EDITOR with options' '
Luke Diamand9afbb2d2015-05-19 23:23:16 +010023 git p4 clone --dest="$git" //depot &&
24 test_when_finished cleanup_git &&
25 (
26 cd "$git" &&
27 echo change >file1 &&
28 git commit -m "change" file1 &&
Nguyễn Thái Ngọc Duy0e496492018-03-24 08:44:31 +010029 P4EDITOR=": >\"$git/touched\" && test-tool chmtime +5" git p4 submit &&
Luke Diamand9afbb2d2015-05-19 23:23:16 +010030 test_path_is_file "$git/touched"
31 )
32'
33
Luke Diamand9afbb2d2015-05-19 23:23:16 +010034test_done