diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-02-17 17:21:43 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-17 17:21:43 -0800 |
commit | e68f62be8dd65cd181be20b414fa45126b39d481 (patch) | |
tree | 4db666f1b5c3b3a08ffeb527673e3305526c0c74 /t | |
parent | Merge branch 'js/commit-graph-warning' (diff) | |
parent | reflog expire --stale-fix: be generous about missing objects (diff) | |
download | tgif-e68f62be8dd65cd181be20b414fa45126b39d481.tar.xz |
Merge branch 'js/reflog-expire-stale-fix'
"git reflog expire --stale-fix" can be used to repair the reflog by
removing entries that refer to objects that have been pruned away,
but was not careful to tolerate missing objects.
* js/reflog-expire-stale-fix:
reflog expire --stale-fix: be generous about missing objects
Diffstat (limited to 't')
-rwxr-xr-x | t/t1410-reflog.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index ecccaa0634..27b9080251 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -158,6 +158,32 @@ test_expect_success 'reflog expire' ' check_fsck "dangling commit $K" ' +test_expect_success '--stale-fix handles missing objects generously' ' + git -c core.logAllRefUpdates=false fast-import --date-format=now <<-EOS && + commit refs/heads/stale-fix + mark :1 + committer Author <a@uth.or> now + data <<EOF + start stale fix + EOF + M 100644 inline file + data <<EOF + contents + EOF + commit refs/heads/stale-fix + committer Author <a@uth.or> now + data <<EOF + stale fix branch tip + EOF + from :1 + EOS + + parent_oid=$(git rev-parse stale-fix^) && + test_when_finished "recover $parent_oid" && + corrupt $parent_oid && + git reflog expire --stale-fix +' + test_expect_success 'prune and fsck' ' git prune && |