aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-06-28 22:24:49 -0700
committerJunio C Hamano <gitster@pobox.com>2008-06-28 22:24:49 -0700
commit60bce2bb8b3cd5ca56f8156cbca16abee151d817 (patch)
tree6fdc87b012f242e60dfbf6b0fa637dcc16fdd2e0
parent3cb22b8efe2cab60dc0ef5e265c414bd826d83ef (diff)
downloadgit-60bce2bb8b3cd5ca56f8156cbca16abee151d817.tar.gz
git-60bce2bb8b3cd5ca56f8156cbca16abee151d817.tar.xz
Make default expiration period of reflog used for stash infinite
This makes the default expiration period for the reflog that implements stash infinite. The original behaviour to autoexpire old stashes can be restored by using the gc.refs/stash.{reflogexpire,reflogexpireunreachable} configration variables introduced by the previous commit. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin-reflog.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/builtin-reflog.c b/builtin-reflog.c
index 071172890..125d455b9 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -441,6 +441,17 @@ static void set_reflog_expiry_param(struct cmd_reflog_expire_cb *cb, int slot, c
}
}
+ /*
+ * If unconfigured, make stash never expire
+ */
+ if (!strcmp(ref, "refs/stash")) {
+ if (!(slot & EXPIRE_TOTAL))
+ cb->expire_total = 0;
+ if (!(slot & EXPIRE_UNREACH))
+ cb->expire_unreachable = 0;
+ return;
+ }
+
/* Nothing matched -- use the default value */
if (!(slot & EXPIRE_TOTAL))
cb->expire_total = default_reflog_expire;