aboutsummaryrefslogtreecommitdiff
path: root/t/t6501-freshen-objects.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-05-29 12:34:54 +0900
committerJunio C Hamano <gitster@pobox.com>2017-05-29 12:34:54 +0900
commitb42b41b75ac686a8a25e2c99779ff4efd6719ca2 (patch)
tree78d1d6a5dd7d4c34651c03125d4bedcd91040816 /t/t6501-freshen-objects.sh
parent69b050eeb8e6a7dceec1de4ab6e974d1787def9f (diff)
parenta3ba6bf10abcaed1819d27fa45675c3a0e141f95 (diff)
downloadgit-b42b41b75ac686a8a25e2c99779ff4efd6719ca2.tar.gz
git-b42b41b75ac686a8a25e2c99779ff4efd6719ca2.tar.xz
Merge branch 'jk/ignore-broken-tags-when-ignoring-missing-links'
Tag objects, which are not reachable from any ref, that point at missing objects were mishandled by "git gc" and friends (they should silently be ignored instead) * jk/ignore-broken-tags-when-ignoring-missing-links: revision.c: ignore broken tags with ignore_missing_links
Diffstat (limited to 't/t6501-freshen-objects.sh')
-rwxr-xr-xt/t6501-freshen-objects.sh27
1 files changed, 26 insertions, 1 deletions
diff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh
index cf076dcd9..394b169ea 100755
--- a/t/t6501-freshen-objects.sh
+++ b/t/t6501-freshen-objects.sh
@@ -129,7 +129,7 @@ for repack in '' true; do
'
done
-test_expect_success 'do not complain about existing broken links' '
+test_expect_success 'do not complain about existing broken links (commit)' '
cat >broken-commit <<-\EOF &&
tree 0000000000000000000000000000000000000001
parent 0000000000000000000000000000000000000002
@@ -144,4 +144,29 @@ test_expect_success 'do not complain about existing broken links' '
test_must_be_empty stderr
'
+test_expect_success 'do not complain about existing broken links (tree)' '
+ cat >broken-tree <<-\EOF &&
+ 100644 blob 0000000000000000000000000000000000000003 foo
+ EOF
+ tree=$(git mktree --missing <broken-tree) &&
+ git gc 2>stderr &&
+ git cat-file -e $tree &&
+ test_must_be_empty stderr
+'
+
+test_expect_success 'do not complain about existing broken links (tag)' '
+ cat >broken-tag <<-\EOF &&
+ object 0000000000000000000000000000000000000004
+ type commit
+ tag broken
+ tagger whatever <whatever@example.com> 1234 -0000
+
+ this is a broken tag
+ EOF
+ tag=$(git hash-object -t tag -w broken-tag) &&
+ git gc 2>stderr &&
+ git cat-file -e $tag &&
+ test_must_be_empty stderr
+'
+
test_done