[PATCH 4/5] Export some more functions to enable resetting the git state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This declares the functions added by the former 2 commits as 'extern'.

Further invalidate_cached_refs() got renamed to
git_invalidate_cached_refs() and is exported too.

Signed-off-by: Christian Thaeter <ct@xxxxxxxxxx>
---
 cache.h |    3 +++
 refs.c  |    6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/cache.h b/cache.h
index 39331c2..4352d08 100644
--- a/cache.h
+++ b/cache.h
@@ -224,7 +224,9 @@ extern char *get_refs_directory(void);
 extern char *get_index_file(void);
 extern char *get_graft_file(void);
 extern int set_git_dir(const char *path);
+extern void reset_git_work_tree(void);
 extern const char *get_git_work_tree(void);
+extern void git_invalidate_cached_refs(void);
 
 #define ALTERNATE_DB_ENVIRONMENT "GIT_ALTERNATE_OBJECT_DIRECTORIES"
 
@@ -553,6 +555,7 @@ extern struct packed_git *parse_pack_index_file(const unsigned char *sha1,
 
 extern void prepare_packed_git(void);
 extern void reprepare_packed_git(void);
+extern void reset_packed_git(void);
 extern void install_packed_git(struct packed_git *pack);
 
 extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
diff --git a/refs.c b/refs.c
index 58f6d17..900cc5d 100644
--- a/refs.c
+++ b/refs.c
@@ -167,7 +167,7 @@ static void free_ref_list(struct ref_list *list)
 	}
 }
 
-static void invalidate_cached_refs(void)
+void git_invalidate_cached_refs(void)
 {
 	struct cached_refs *ca = &cached_refs;
 
@@ -898,7 +898,7 @@ int delete_ref(const char *refname, const unsigned char *sha1)
 	if (err && errno != ENOENT)
 		fprintf(stderr, "warning: unlink(%s) failed: %s",
 			git_path("logs/%s", lock->ref_name), strerror(errno));
-	invalidate_cached_refs();
+	git_invalidate_cached_refs();
 	unlock_ref(lock);
 	return ret;
 }
@@ -1137,7 +1137,7 @@ int write_ref_sha1(struct ref_lock *lock,
 		unlock_ref(lock);
 		return -1;
 	}
-	invalidate_cached_refs();
+	git_invalidate_cached_refs();
 	if (log_ref_write(lock->ref_name, lock->old_sha1, sha1, logmsg) < 0 ||
 	    (strcmp(lock->ref_name, lock->orig_ref_name) &&
 	     log_ref_write(lock->orig_ref_name, lock->old_sha1, sha1, logmsg) < 0)) {
-- 
1.5.3.7

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux