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>
Junio C Hamano committed
Jun 28, 2008 at 22:24 UTC
60bce2bb8b3cd5ca56f8156cbca16abee151d817
1 file changed
+11
builtin-reflog.c
+11
@@ -441,6 +441,17 @@ static void set_reflog_expiry_param(struct cmd_reflog_expire_cb *cb, int slot, c
441
}
442
}
443
444
+ /*
445
+ * If unconfigured, make stash never expire
446
+ */
447
+ if (!strcmp(ref, "refs/stash")) {
448
+ if (!(slot & EXPIRE_TOTAL))
449
+ cb->expire_total = 0;
450
+ if (!(slot & EXPIRE_UNREACH))
451
+ cb->expire_unreachable = 0;
452
+ return;
453
+ }
454
+
455
/* Nothing matched -- use the default value */
456
if (!(slot & EXPIRE_TOTAL))
457
cb->expire_total = default_reflog_expire;