@@ -755,7 +755,7 @@ void wt_status_collect(struct wt_status *s)
755
755
wt_status_collect_changes_index (s );
756
756
wt_status_collect_untracked (s );
757
757
758
- wt_status_get_state (& s -> state , s -> branch && !strcmp (s -> branch , "HEAD" ));
758
+ wt_status_get_state (s -> repo , & s -> state , s -> branch && !strcmp (s -> branch , "HEAD" ));
759
759
if (s -> state .merge_in_progress && !has_unmerged (s ))
760
760
s -> committable = 1 ;
761
761
}
@@ -1482,7 +1482,8 @@ static int grab_1st_switch(struct object_id *ooid, struct object_id *noid,
1482
1482
return 1 ;
1483
1483
}
1484
1484
1485
- static void wt_status_get_detached_from (struct wt_status_state * state )
1485
+ static void wt_status_get_detached_from (struct repository * r ,
1486
+ struct wt_status_state * state )
1486
1487
{
1487
1488
struct grab_1st_switch_cbdata cb ;
1488
1489
struct commit * commit ;
@@ -1499,7 +1500,7 @@ static void wt_status_get_detached_from(struct wt_status_state *state)
1499
1500
/* sha1 is a commit? match without further lookup */
1500
1501
(oideq (& cb .noid , & oid ) ||
1501
1502
/* perhaps sha1 is a tag, try to dereference to a commit */
1502
- ((commit = lookup_commit_reference_gently (the_repository , & oid , 1 )) != NULL &&
1503
+ ((commit = lookup_commit_reference_gently (r , & oid , 1 )) != NULL &&
1503
1504
oideq (& cb .noid , & commit -> object .oid )))) {
1504
1505
const char * from = ref ;
1505
1506
if (!skip_prefix (from , "refs/tags/" , & from ))
@@ -1556,30 +1557,31 @@ int wt_status_check_bisect(const struct worktree *wt,
1556
1557
return 0 ;
1557
1558
}
1558
1559
1559
- void wt_status_get_state (struct wt_status_state * state ,
1560
+ void wt_status_get_state (struct repository * r ,
1561
+ struct wt_status_state * state ,
1560
1562
int get_detached_from )
1561
1563
{
1562
1564
struct stat st ;
1563
1565
struct object_id oid ;
1564
1566
1565
- if (!stat (git_path_merge_head (the_repository ), & st )) {
1567
+ if (!stat (git_path_merge_head (r ), & st )) {
1566
1568
state -> merge_in_progress = 1 ;
1567
1569
} else if (wt_status_check_rebase (NULL , state )) {
1568
1570
; /* all set */
1569
- } else if (!stat (git_path_cherry_pick_head (the_repository ), & st ) &&
1571
+ } else if (!stat (git_path_cherry_pick_head (r ), & st ) &&
1570
1572
!get_oid ("CHERRY_PICK_HEAD" , & oid )) {
1571
1573
state -> cherry_pick_in_progress = 1 ;
1572
1574
oidcpy (& state -> cherry_pick_head_oid , & oid );
1573
1575
}
1574
1576
wt_status_check_bisect (NULL , state );
1575
- if (!stat (git_path_revert_head (the_repository ), & st ) &&
1577
+ if (!stat (git_path_revert_head (r ), & st ) &&
1576
1578
!get_oid ("REVERT_HEAD" , & oid )) {
1577
1579
state -> revert_in_progress = 1 ;
1578
1580
oidcpy (& state -> revert_head_oid , & oid );
1579
1581
}
1580
1582
1581
1583
if (get_detached_from )
1582
- wt_status_get_detached_from (state );
1584
+ wt_status_get_detached_from (r , state );
1583
1585
}
1584
1586
1585
1587
static void wt_longstatus_print_state (struct wt_status * s )
0 commit comments