aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2010-02-13 22:28:35 +0100
committerJunio C Hamano <gitster@pobox.com>2010-02-13 19:36:16 -0800
commit348f199b2d9250a82453323c90b7e8d3d9462220 (patch)
tree8488d43362495adda6d99893ac339f11829d5992 /t
parentaaec9bcf6d85a084725e8386bf314a6ef6842468 (diff)
downloadgit-348f199b2d9250a82453323c90b7e8d3d9462220.tar.gz
git-348f199b2d9250a82453323c90b7e8d3d9462220.tar.xz
builtin-notes: Refactor handling of -F option to allow combining -m and -F
By moving the -F option handling into a separate function (parse_file_arg), we can start allowing several -F options, and mixed usage of -m and -F options. Each -m/-F given appends to the note message, in the order they are given on the command-line. The patch includes tests verifying correct behaviour of the new functionality. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3301-notes.sh23
1 files changed, 22 insertions, 1 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 290ed63d4..07090e399 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -284,8 +284,29 @@ test_expect_success 'verify non-creation of note with -m ""' '
! git notes show
'
+cat > expect-combine_m_and_F << EOF
+foo
+
+xyzzy
+
+bar
+
+zyxxy
+
+baz
+EOF
+
+test_expect_success 'create note with combination of -m and -F' '
+ echo "xyzzy" > note_a &&
+ echo "zyxxy" > note_b &&
+ git notes add -m "foo" -F note_a -m "bar" -F note_b -m "baz" &&
+ git notes show > output &&
+ test_cmp expect-combine_m_and_F output
+'
+
test_expect_success 'remove note with "git notes remove" (setup)' '
- git notes remove HEAD^
+ git notes remove HEAD^ &&
+ git notes remove
'
cat > expect-rm-remove << EOF