aboutsummaryrefslogtreecommitdiff
path: root/t/t3301-notes.sh
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2010-11-09 22:49:57 +0100
committerJunio C Hamano <gitster@pobox.com>2010-11-17 13:23:55 -0800
commit618cd75707580819f19a5f01dba406ac72219c78 (patch)
treee034bdf9577152b30295eb92f56ff84fb1405ee3 /t/t3301-notes.sh
parent305ddd444ee66607581c014b371ed74af534eca5 (diff)
downloadgit-618cd75707580819f19a5f01dba406ac72219c78.tar.gz
git-618cd75707580819f19a5f01dba406ac72219c78.tar.xz
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-xt/t3301-notes.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 4bf4e52e6..f5b72c7b0 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