notes.h: Make default_notes_ref() available in notes API
Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johan Herland committed
Nov 9, 2010 at 22:49 UTC
4a9cf1cefc0fd05e0eb46f862e398f1e4ac1c9a7
2 files changed
+15
-1
notes.c
+1
-1
@@ -898,7 +898,7 @@ static int notes_display_config(const char *k, const char *v, void *cb)
898
return 0;
899
}
900
901
-static const char *default_notes_ref(void)
901
+const char *default_notes_ref(void)
902
{
903
const char *notes_ref = NULL;
904
if (!notes_ref)
notes.h
+14
@@ -43,6 +43,20 @@ extern struct notes_tree {
43
int dirty;
44
} default_notes_tree;
45
46
+/*
47
+ * Return the default notes ref.
48
+ *
49
+ * The default notes ref is the notes ref that is used when notes_ref == NULL
50
+ * is passed to init_notes().
51
+ *
52
+ * This the first of the following to be defined:
53
+ * 1. The '--ref' option to 'git notes', if given
54
+ * 2. The $GIT_NOTES_REF environment variable, if set
55
+ * 3. The value of the core.notesRef config variable, if set
56
+ * 4. GIT_NOTES_DEFAULT_REF (i.e. "refs/notes/commits")
57
+ */
58
+const char *default_notes_ref(void);
59
+
60
/*
61
* Flags controlling behaviour of notes tree initialization
62
*