diff options
author | Johan Herland <johan@herland.net> | 2010-11-09 22:49:57 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-11-17 13:23:55 -0800 |
commit | 618cd75707580819f19a5f01dba406ac72219c78 (patch) | |
tree | e034bdf9577152b30295eb92f56ff84fb1405ee3 /t/t3301-notes.sh | |
parent | 305ddd444ee66607581c014b371ed74af534eca5 (diff) | |
download | git-618cd75707580819f19a5f01dba406ac72219c78.tar.gz |
Provide 'git notes get-ref' to easily retrieve current notes ref
Script may use 'git notes get-ref' to easily retrieve the current notes ref.
Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3301-notes.sh')
-rwxr-xr-x | t/t3301-notes.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh index 4bf4e52e6c..f5b72c7b00 100755 --- a/t/t3301-notes.sh +++ b/t/t3301-notes.sh @@ -1058,4 +1058,23 @@ test_expect_success 'git notes copy diagnoses too many or too few parameters' ' test_must_fail git notes copy one two three ' +test_expect_success 'git notes get-ref (no overrides)' ' + git config --unset core.notesRef && + unset GIT_NOTES_REF && + test "$(git notes get-ref)" = "refs/notes/commits" +' + +test_expect_success 'git notes get-ref (core.notesRef)' ' + git config core.notesRef refs/notes/foo && + test "$(git notes get-ref)" = "refs/notes/foo" +' + +test_expect_success 'git notes get-ref (GIT_NOTES_REF)' ' + test "$(GIT_NOTES_REF=refs/notes/bar git notes get-ref)" = "refs/notes/bar" +' + +test_expect_success 'git notes get-ref (--ref)' ' + test "$(GIT_NOTES_REF=refs/notes/bar git notes --ref=baz get-ref)" = "refs/notes/baz" +' + test_done |