Skip to content

Commit ec06b05

Browse files
jonathantanmygitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a4f66a7 commit ec06b05

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

refs.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -623,11 +623,6 @@ int repo_dwim_ref(struct repository *r, const char *str, int len,
623623
return refs_found;
624624
}
625625

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-
631626
int expand_ref(struct repository *repo, const char *str, int len,
632627
struct object_id *oid, char **ref)
633628
{

refs.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef REFS_H
22
#define REFS_H
33

4+
#include "cache.h"
5+
46
struct object_id;
57
struct ref_store;
68
struct repository;
@@ -151,7 +153,11 @@ void expand_ref_prefix(struct argv_array *prefixes, const char *prefix);
151153
int expand_ref(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);
152154
int repo_dwim_ref(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);
153155
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+
}
155161
int dwim_log(const char *str, int len, struct object_id *oid, char **ref);
156162

157163
/*

0 commit comments

Comments
 (0)