refs: rename lookup_ref_store() to lookup_submodule_ref_store()
With get_main_ref_store() being used inside get_ref_store(), lookup_ref_store() is only used for submodule code path. Rename to reflect that and delete dead code. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Mar 26, 2017 at 09:42 UTC
9476c6ed3dcf89b045d567c153f50de9528dd0ba
1 file changed
+4
-9
refs.c
+4
-9
@@ -1395,17 +1395,13 @@ static struct ref_store *main_ref_store;
1395
static struct hashmap submodule_ref_stores;
1396
1397
/*
1398
- * Return the ref_store instance for the specified submodule (or the
1399
- * main repository if submodule is NULL). If that ref_store hasn't
1400
- * been initialized yet, return NULL.
1398
+ * Return the ref_store instance for the specified submodule. If that
1399
+ * ref_store hasn't been initialized yet, return NULL.
1400
*/
1402
-static struct ref_store *lookup_ref_store(const char *submodule)
1401
+static struct ref_store *lookup_submodule_ref_store(const char *submodule)
1402
{
1403
struct submodule_hash_entry *entry;
1404
1406
- if (!submodule)
1407
- return main_ref_store;
1408
-
1405
if (!submodule_ref_stores.tablesize)
1406
/* It's initialized on demand in register_ref_store(). */
1407
return NULL;
@@ -1471,7 +1467,7 @@ struct ref_store *get_ref_store(const char *submodule)
1467
if (!submodule || !*submodule) {
1468
return get_main_ref_store();
1469
} else {
1474
- refs = lookup_ref_store(submodule);
1470
+ refs = lookup_submodule_ref_store(submodule);
1471
1472
if (!refs) {
1473
struct strbuf submodule_sb = STRBUF_INIT;
@@ -1482,7 +1478,6 @@ struct ref_store *get_ref_store(const char *submodule)
1478
strbuf_release(&submodule_sb);
1479
}
1480
}
1485
-
1481
return refs;
1482
}
1483