Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
refs.c: introduce get_main_ref_store()
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Sun, 26 Mar 2017 02:42:25 +0000
(09:42 +0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 27 Mar 2017 17:23:39 +0000
(10:23 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
f57f37e
)
diff --git
a/refs.c
b/refs.c
index e7606716ddfff47b29f90e4d46cb2d59633cb455..8aa33af4e8e34014d55e696f19aa565927e2b034 100644
(file)
--- a/
refs.c
+++ b/
refs.c
@@
-1456,15
+1456,20
@@
static struct ref_store *ref_store_init(const char *submodule)
return refs;
}
+static struct ref_store *get_main_ref_store(void)
+{
+ if (main_ref_store)
+ return main_ref_store;
+
+ return ref_store_init(NULL);
+}
+
struct ref_store *get_ref_store(const char *submodule)
{
struct ref_store *refs;
if (!submodule || !*submodule) {
- refs = lookup_ref_store(NULL);
-
- if (!refs)
- refs = ref_store_init(NULL);
+ return get_main_ref_store();
} else {
refs = lookup_ref_store(submodule);