Skip to content

Commit 60bce2b

Browse files
committed
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 <[email protected]>
1 parent 3cb22b8 commit 60bce2b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

builtin-reflog.c

+11
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,17 @@ static void set_reflog_expiry_param(struct cmd_reflog_expire_cb *cb, int slot, c
441441
}
442442
}
443443

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+
444455
/* Nothing matched -- use the default value */
445456
if (!(slot & EXPIRE_TOTAL))
446457
cb->expire_total = default_reflog_expire;

0 commit comments

Comments
 (0)