File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2387,7 +2387,8 @@ static void try_remove_empty_parents(char *name)
2387
2387
/* make sure nobody touched the ref, and unlink */
2388
2388
static void prune_ref (struct ref_to_prune * r )
2389
2389
{
2390
- struct ref_lock * lock = lock_ref_sha1 (r -> name + 5 , r -> sha1 );
2390
+ struct ref_lock * lock = lock_any_ref_for_update (r -> name , r -> sha1 ,
2391
+ 0 , NULL );
2391
2392
2392
2393
if (lock ) {
2393
2394
unlink_or_warn (git_path ("%s" , r -> name ));
Original file line number Diff line number Diff line change @@ -151,4 +151,11 @@ test_expect_success 'delete ref while another dangling packed ref' '
151
151
test_cmp /dev/null result
152
152
'
153
153
154
+ test_expect_success ' pack ref directly below refs/' '
155
+ git update-ref refs/top HEAD &&
156
+ git pack-refs --all --prune &&
157
+ grep refs/top .git/packed-refs &&
158
+ test_path_is_missing .git/refs/top
159
+ '
160
+
154
161
test_done
You can’t perform that action at this time.
0 commit comments