summaryrefslogtreecommitdiff
path: root/builtin-rerere.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-27 09:24:05 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-12-27 09:33:24 (GMT)
commit48c3242450fe5fb18e6890812c000ed5c6291a98 (patch)
treeb8325ffabcccbdc389395e1b6e828c77d1029362 /builtin-rerere.c
parentae72f685418b79bbd67e1017c5b1ac7d731c042e (diff)
downloadgit-48c3242450fe5fb18e6890812c000ed5c6291a98.zip
git-48c3242450fe5fb18e6890812c000ed5c6291a98.tar.gz
git-48c3242450fe5fb18e6890812c000ed5c6291a98.tar.bz2
rerere gc: honor configuration and document it
Two configuration to control the expiration of rerere records are introduced and documented. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-rerere.c')
-rw-r--r--builtin-rerere.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/builtin-rerere.c b/builtin-rerere.c
index d064bd8..7442498 100644
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
@@ -362,6 +362,17 @@ tail_optimization:
return write_rr(rr, fd);
}
+static int git_rerere_config(const char *var, const char *value)
+{
+ if (!strcmp(var, "gc.rerereresolved"))
+ cutoff_resolve = git_config_int(var, value);
+ else if (!strcmp(var, "gc.rerereunresolved"))
+ cutoff_noresolve = git_config_int(var, value);
+ else
+ return git_default_config(var, value);
+ return 0;
+}
+
int cmd_rerere(int argc, const char **argv, const char *prefix)
{
struct path_list merge_rr = { NULL, 0, 0, 1 };
@@ -371,6 +382,8 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
if (stat(git_path("rr-cache"), &st) || !S_ISDIR(st.st_mode))
return 0;
+ git_config(git_rerere_config);
+
merge_rr_path = xstrdup(git_path("rr-cache/MERGE_RR"));
fd = hold_lock_file_for_update(&write_lock, merge_rr_path, 1);
read_rr(&merge_rr);