Skip to content

Commit e0fd1e3

Browse files
committed
Merge branch 'sb/refs-code-cleanup'
* sb/refs-code-cleanup: cache: remove unused function 'have_git_dir' refs: remove unused function invalidate_ref_cache
2 parents c9bb7d0 + 84471a1 commit e0fd1e3

File tree

4 files changed

+0
-21
lines changed

4 files changed

+0
-21
lines changed

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ extern int is_bare_repository(void);
398398
extern int is_inside_git_dir(void);
399399
extern char *git_work_tree_cfg;
400400
extern int is_inside_work_tree(void);
401-
extern int have_git_dir(void);
402401
extern const char *get_git_dir(void);
403402
extern int is_git_directory(const char *path);
404403
extern char *get_object_directory(void);

environment.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,6 @@ int is_bare_repository(void)
155155
return is_bare_repository_cfg && !get_git_work_tree();
156156
}
157157

158-
int have_git_dir(void)
159-
{
160-
return !!git_dir;
161-
}
162-
163158
const char *get_git_dir(void)
164159
{
165160
if (!git_dir)

refs.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -947,13 +947,6 @@ static struct ref_cache *get_ref_cache(const char *submodule)
947947
return refs;
948948
}
949949

950-
void invalidate_ref_cache(const char *submodule)
951-
{
952-
struct ref_cache *refs = get_ref_cache(submodule);
953-
clear_packed_ref_cache(refs);
954-
clear_loose_ref_cache(refs);
955-
}
956-
957950
/* The length of a peeled reference line in packed-refs, including EOL: */
958951
#define PEELED_LINE_LENGTH 42
959952

refs.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,6 @@ extern void unlock_ref(struct ref_lock *lock);
165165
/** Writes sha1 into the ref specified by the lock. **/
166166
extern int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *msg);
167167

168-
/*
169-
* Invalidate the reference cache for the specified submodule. Use
170-
* submodule=NULL to invalidate the cache for the main module. This
171-
* function must be called if references are changed via a mechanism
172-
* other than the refs API.
173-
*/
174-
extern void invalidate_ref_cache(const char *submodule);
175-
176168
/** Setup reflog before using. **/
177169
int log_ref_setup(const char *ref_name, char *logfile, int bufsize);
178170

0 commit comments

Comments
 (0)