mirror of
https://github.com/git/git.git
synced 2024-11-23 18:05:29 +08:00
Merge branch 'jk/prune-top-level-refs-after-packing'
After "pack-refs --prune" packed refs at the top-level, it failed to prune them. * jk/prune-top-level-refs-after-packing: pack-refs: prune top-level refs like "refs/foo"
This commit is contained in:
commit
88e7dff93d
2
refs.c
2
refs.c
@ -2389,7 +2389,7 @@ static void prune_ref(struct ref_to_prune *r)
|
||||
struct ref_transaction *transaction;
|
||||
struct strbuf err = STRBUF_INIT;
|
||||
|
||||
if (check_refname_format(r->name + 5, 0))
|
||||
if (check_refname_format(r->name, 0))
|
||||
return;
|
||||
|
||||
transaction = ref_transaction_begin(&err);
|
||||
|
@ -151,4 +151,11 @@ test_expect_success 'delete ref while another dangling packed ref' '
|
||||
test_cmp /dev/null result
|
||||
'
|
||||
|
||||
test_expect_success 'pack ref directly below refs/' '
|
||||
git update-ref refs/top HEAD &&
|
||||
git pack-refs --all --prune &&
|
||||
grep refs/top .git/packed-refs &&
|
||||
test_path_is_missing .git/refs/top
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Loading…
Reference in New Issue
Block a user