Revision f33c2c0f9e2258a80e6e406af39e9fa3fd6e430e authored by Ramkumar Ramachandra on 05 January 2014, 10:18:03 UTC, committed by Junio C Hamano on 06 January 2014, 17:14:48 UTC
There are situations where multiple classes of completions possible. For
example

  branch.<TAB>

should try to complete

  branch.master.
  branch.autosetupmerge
  branch.autosetuprebase

The first candidate has the suffix ".", and the second/ third candidates
have the suffix " ". To facilitate completions of this kind, create a
variation of __gitcomp_nl () that appends to the existing list of
completion candidates, COMPREPLY.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent d028b89
Raw File
t3307-notes-man.sh
#!/bin/sh

test_description='Examples from the git-notes man page

Make sure the manual is not full of lies.'

. ./test-lib.sh

test_expect_success 'setup' '
	test_commit A &&
	test_commit B &&
	test_commit C
'

test_expect_success 'example 1: notes to add an Acked-by line' '
	cat <<-\EOF >expect &&
	    B

	Notes:
	    Acked-by: A C Ker <acker@example.com>
	EOF
	git notes add -m "Acked-by: A C Ker <acker@example.com>" B &&
	git show -s B^{commit} >log &&
	tail -n 4 log >actual &&
	test_cmp expect actual
'

test_expect_success 'example 2: binary notes' '
	cp "$TEST_DIRECTORY"/test-binary-1.png . &&
	git checkout B &&
	blob=$(git hash-object -w test-binary-1.png) &&
	git notes --ref=logo add -C "$blob" &&
	git notes --ref=logo copy B C &&
	git notes --ref=logo show C >actual &&
	test_cmp test-binary-1.png actual
'

test_done
back to top