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)
23872387/* make sure nobody touched the ref, and unlink */
23882388static void prune_ref (struct ref_to_prune * r )
23892389{
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 );
23912392
23922393 if (lock ) {
23932394 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' '
151151 test_cmp /dev/null result
152152'
153153
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+
154161test_done
You can’t perform that action at this time.
0 commit comments