Skip to content

Commit 9afbb2d

Browse files
luked99gitster
authored andcommitted
git-p4: add failing test for P4EDITOR handling
Add test case that git-p4 handles a setting of P4EDITOR that takes arguments, e.g. "gvim -f". This currently fails. Signed-off-by: Luke Diamand <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16018ae commit 9afbb2d

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

t/t9820-git-p4-editor-handling.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
3+
test_description='git p4 handling of EDITOR'
4+
5+
. ./lib-git-p4.sh
6+
7+
test_expect_success 'start p4d' '
8+
start_p4d
9+
'
10+
11+
test_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.
22+
test_expect_failure 'EDITOR with options' '
23+
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 &&
29+
P4EDITOR=": >\"$git/touched\" && test-chmtime +5" git p4 submit &&
30+
test_path_is_file "$git/touched"
31+
)
32+
'
33+
34+
test_expect_success 'kill p4d' '
35+
kill_p4d
36+
'
37+
38+
test_done

0 commit comments

Comments
 (0)