diff options
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -4081,10 +4081,13 @@ int reflog_expire(const char *refname, const unsigned char *sha1, /* * It doesn't make sense to adjust a reference pointed * to by a symbolic ref based on expiring entries in - * the symbolic reference's reflog. + * the symbolic reference's reflog. Nor can we update + * a reference if there are no remaining reflog + * entries. */ int update = (flags & EXPIRE_REFLOGS_UPDATE_REF) && - !(type & REF_ISSYMREF); + !(type & REF_ISSYMREF) && + !is_null_sha1(cb.last_kept_sha1); if (close_lock_file(&reflog_lock)) { status |= error("couldn't write %s: %s", log_file, |