From: Junio C Hamano Date: Mon, 25 Mar 2013 21:00:39 +0000 (-0700) Subject: Merge branch 'jc/maint-reflog-expire-clean-mark-typofix' X-Git-Tag: v1.8.3-rc0~183 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/212ca64fb4a50178bf8a83c7b1bab15da5c9ab4c?hp=-c Merge branch 'jc/maint-reflog-expire-clean-mark-typofix' In "git reflog expire", REACHABLE bit was not cleared from the correct objects. * jc/maint-reflog-expire-clean-mark-typofix: reflog: fix typo in "reflog expire" clean-up codepath --- 212ca64fb4a50178bf8a83c7b1bab15da5c9ab4c diff --combined builtin/reflog.c index 1fedf66329,ef56e7b119..72a0af70c3 --- a/builtin/reflog.c +++ b/builtin/reflog.c @@@ -414,7 -414,7 +414,7 @@@ static int expire_reflog(const char *re if (cb.unreachable_expire_kind == UE_HEAD) { struct commit_list *elem; for (elem = tips; elem; elem = elem->next) - clear_commit_marks(tip_commit, REACHABLE); + clear_commit_marks(elem->item, REACHABLE); free_commit_list(tips); } else { clear_commit_marks(tip_commit, REACHABLE); @@@ -510,27 -510,26 +510,27 @@@ static int parse_expire_cfg_value(cons static int reflog_expire_config(const char *var, const char *value, void *cb) { - const char *lastdot = strrchr(var, '.'); + const char *pattern, *key; + int pattern_len; unsigned long expire; int slot; struct reflog_expire_cfg *ent; - if (!lastdot || prefixcmp(var, "gc.")) + if (parse_config_key(var, "gc", &pattern, &pattern_len, &key) < 0) return git_default_config(var, value, cb); - if (!strcmp(lastdot, ".reflogexpire")) { + if (!strcmp(key, "reflogexpire")) { slot = EXPIRE_TOTAL; if (parse_expire_cfg_value(var, value, &expire)) return -1; - } else if (!strcmp(lastdot, ".reflogexpireunreachable")) { + } else if (!strcmp(key, "reflogexpireunreachable")) { slot = EXPIRE_UNREACH; if (parse_expire_cfg_value(var, value, &expire)) return -1; } else return git_default_config(var, value, cb); - if (lastdot == var + 2) { + if (!pattern) { switch (slot) { case EXPIRE_TOTAL: default_reflog_expire = expire; @@@ -542,7 -541,7 +542,7 @@@ return 0; } - ent = find_cfg_ent(var + 3, lastdot - (var+3)); + ent = find_cfg_ent(pattern, pattern_len); if (!ent) return -1; switch (slot) {