summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorPete Wyckoff <pw@padd.com>2011-12-17 17:39:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-12-18 02:20:27 (GMT)
commitd16520499d2652b5b59dfb25f9cf2d56a4c6913a (patch)
tree874bde050ffa44e1b4945e76ec9d0c923f45818d /t
parentee228024933069b93ce23a1bd5eeb7ae12c792f2 (diff)
downloadgit-d16520499d2652b5b59dfb25f9cf2d56a4c6913a.zip
git-d16520499d2652b5b59dfb25f9cf2d56a4c6913a.tar.gz
git-d16520499d2652b5b59dfb25f9cf2d56a4c6913a.tar.bz2
git-p4: fix skipSubmitEdit regression
Commit 7c766e5 (git-p4: introduce skipSubmitEdit, 2011-12-04) made it easier to automate submission to p4, but broke the most common case. Add a test for when the user really does edit and save the change template, and fix the bug that causes the test to fail. Also add a confirmation message when submission is cancelled. Reported-by: Michael Horowitz <michael.horowitz@ieee.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t9805-skip-submit-edit.sh24
1 files changed, 23 insertions, 1 deletions
diff --git a/t/t9805-skip-submit-edit.sh b/t/t9805-skip-submit-edit.sh
index 734ccf2..df929e0 100755
--- a/t/t9805-skip-submit-edit.sh
+++ b/t/t9805-skip-submit-edit.sh
@@ -38,7 +38,7 @@ test_expect_success 'no config, unedited, say no' '
cd "$git" &&
echo line >>file1 &&
git commit -a -m "change 3 (not really)" &&
- printf "bad response\nn\n" | "$GITP4" submit
+ printf "bad response\nn\n" | "$GITP4" submit &&
p4 changes //depot/... >wc &&
test_line_count = 2 wc
)
@@ -74,6 +74,28 @@ test_expect_success 'skipSubmitEditCheck' '
)
'
+# check the normal case, where the template really is edited
+test_expect_success 'no config, edited' '
+ "$GITP4" clone --dest="$git" //depot &&
+ test_when_finished cleanup_git &&
+ ed="$TRASH_DIRECTORY/ed.sh" &&
+ test_when_finished "rm \"$ed\"" &&
+ cat >"$ed" <<-EOF &&
+ #!$SHELL_PATH
+ sleep 1
+ touch "\$1"
+ exit 0
+ EOF
+ chmod 755 "$ed" &&
+ (
+ cd "$git" &&
+ echo line >>file1 &&
+ git commit -a -m "change 5" &&
+ EDITOR="\"$ed\"" "$GITP4" submit &&
+ p4 changes //depot/... >wc &&
+ test_line_count = 5 wc
+ )
+'
test_expect_success 'kill p4d' '
kill_p4d