aboutsummaryrefslogtreecommitdiff
path: root/server-info.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-14 13:15:53 -0700
committerJunio C Hamano <junkio@cox.net>2005-09-15 12:46:32 -0700
commit60d0526aaa5d29589420bfadd0623ec878c5edf3 (patch)
treebd9981dbdede66822e1aca6fe0a4dc1daeb46b40 /server-info.c
parent0f56479d7325083953be36b8c8ee90380ff27f92 (diff)
downloadgit-60d0526aaa5d29589420bfadd0623ec878c5edf3.tar.gz
git-60d0526aaa5d29589420bfadd0623ec878c5edf3.tar.xz
Unoptimize info/refs creation.
The code did not catch the case where you removed an existing ref without changing anything else. We are not talking about hundreds of refs anyway, so remove that optimization. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'server-info.c')
-rw-r--r--server-info.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/server-info.c b/server-info.c
index 3263035b9..a9e5607f2 100644
--- a/server-info.c
+++ b/server-info.c
@@ -6,16 +6,6 @@
/* refs */
static FILE *info_ref_fp;
-static unsigned long info_ref_time;
-static int info_ref_is_stale = 0;
-
-static int stat_ref(const char *path, const unsigned char *sha1)
-{
- struct stat st;
- if (!stat(path, &st) && info_ref_time < st.st_mtime)
- info_ref_is_stale = 1;
- return 0;
-}
static int add_info_ref(const char *path, const unsigned char *sha1)
{
@@ -25,7 +15,6 @@ static int add_info_ref(const char *path, const unsigned char *sha1)
static int update_info_refs(int force)
{
- struct stat st;
char *path0 = strdup(git_path("info/refs"));
int len = strlen(path0);
char *path1 = xmalloc(len + 2);
@@ -33,21 +22,6 @@ static int update_info_refs(int force)
strcpy(path1, path0);
strcpy(path1 + len, "+");
- if (!force) {
- if (stat(path0, &st)) {
- if (errno == ENOENT)
- info_ref_is_stale = 1;
- else
- return error("cannot stat %s", path0);
- }
- else {
- info_ref_time = st.st_mtime;
- for_each_ref(stat_ref);
- }
- if (!info_ref_is_stale)
- return 0;
- }
-
safe_create_leading_directories(path0);
info_ref_fp = fopen(path1, "w");
if (!info_ref_fp)