From b7638fed427f4aab36ad8ff36fe06f0e4b5c98e4 Mon Sep 17 00:00:00 2001 From: GIRARD Etienne Date: Tue, 24 Nov 2015 07:43:59 +0000 Subject: git-p4: clean up after p4 submit failure When "p4 submit" command fails in P4Submit.applyCommit, the workspace is left with the changes. We already have code to revert the changes to the workspace when the user decides to cancel submission by aborting the editor that edits the change description, and we should treat the "p4 submit" failure the same way. Clean the workspace if p4_write_pipe raised SystemExit, so that the user don't have to do it themselves. Signed-off-by: GIRARD Etienne Signed-off-by: Junio C Hamano Signed-off-by: Luke Diamand Signed-off-by: Jeff King --- t/t9807-git-p4-submit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t9807-git-p4-submit.sh') diff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh index 1f74a8838..593152817 100755 --- a/t/t9807-git-p4-submit.sh +++ b/t/t9807-git-p4-submit.sh @@ -389,7 +389,7 @@ test_expect_success 'description with Jobs section and bogus following text' ' ( cd "$cli" && p4 revert desc6 && - rm desc6 + rm -f desc6 ) ' -- cgit v1.2.1