@matheusbsbs / matheus-bagliano / commits / ec06b05568
Fork 0

refs: move dwim_ref() to header file

This makes it clear that dwim_ref() is just repo_dwim_ref() without the first parameter. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Tan committed Sep 1, 2020 at 15:28 UTC ec06b05568bb9dbb7333a5974b4512db18395674
2 files changed +7 -6
refs.c
-5
@@ -623,11 +623,6 @@ int repo_dwim_ref(struct repository *r, const char *str, int len,
623 return refs_found;
624 }
625
626 -int dwim_ref(const char *str, int len, struct object_id *oid, char **ref)
627 -{
628 - return repo_dwim_ref(the_repository, str, len, oid, ref);
629 -}
630 -
626 int expand_ref(struct repository *repo, const char *str, int len,
627 struct object_id *oid, char **ref)
628 {
refs.h
+7 -1
@@ -1,6 +1,8 @@
1 #ifndef REFS_H
2 #define REFS_H
3
4 +#include "cache.h"
5 +
6 struct object_id;
7 struct ref_store;
8 struct repository;
@@ -151,7 +153,11 @@ void expand_ref_prefix(struct argv_array *prefixes, const char *prefix);
153 int expand_ref(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);
154 int repo_dwim_ref(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);
155 int repo_dwim_log(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);
154 -int dwim_ref(const char *str, int len, struct object_id *oid, char **ref);
156 +static inline int dwim_ref(const char *str, int len, struct object_id *oid,
157 + char **ref)
158 +{
159 + return repo_dwim_ref(the_repository, str, len, oid, ref);
160 +}
161 int dwim_log(const char *str, int len, struct object_id *oid, char **ref);
162
163 /*