Skip to content

Commit

Permalink
Make default expiration period of reflog used for stash infinite
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jun 29, 2008
1 parent 3cb22b8 commit 60bce2b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions builtin-reflog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 60bce2b

Please sign in to comment.