@@ -361,8 +361,8 @@ static void wt_longstatus_print_change_data(struct wt_status *s,
361
361
switch (change_type ) {
362
362
case WT_STATUS_UPDATED :
363
363
status = d -> index_status ;
364
- if (d -> head_path )
365
- one_name = d -> head_path ;
364
+ if (d -> rename_source )
365
+ one_name = d -> rename_source ;
366
366
break ;
367
367
case WT_STATUS_CHANGED :
368
368
if (d -> new_submodule_commits || d -> dirty_submodule ) {
@@ -392,7 +392,7 @@ static void wt_longstatus_print_change_data(struct wt_status *s,
392
392
die ("BUG: unhandled diff status %c" , status );
393
393
len = label_width - utf8_strwidth (what );
394
394
assert (len >= 0 );
395
- if (status == DIFF_STATUS_COPIED || status == DIFF_STATUS_RENAMED )
395
+ if (one_name != two_name )
396
396
status_printf_more (s , c , "%s%.*s%s -> %s" ,
397
397
what , len , padding , one , two );
398
398
else
@@ -532,8 +532,9 @@ static void wt_status_collect_updated_cb(struct diff_queue_struct *q,
532
532
533
533
case DIFF_STATUS_COPIED :
534
534
case DIFF_STATUS_RENAMED :
535
- d -> head_path = xstrdup (p -> one -> path );
536
- d -> score = p -> score * 100 / MAX_SCORE ;
535
+ d -> rename_source = xstrdup (p -> one -> path );
536
+ d -> rename_score = p -> score * 100 / MAX_SCORE ;
537
+ d -> rename_status = p -> status ;
537
538
/* fallthru */
538
539
case DIFF_STATUS_MODIFIED :
539
540
case DIFF_STATUS_TYPE_CHANGED :
@@ -1691,13 +1692,14 @@ static void wt_shortstatus_status(struct string_list_item *it,
1691
1692
putchar (' ' );
1692
1693
if (s -> null_termination ) {
1693
1694
fprintf (stdout , "%s%c" , it -> string , 0 );
1694
- if (d -> head_path )
1695
- fprintf (stdout , "%s%c" , d -> head_path , 0 );
1695
+ if (d -> rename_source )
1696
+ fprintf (stdout , "%s%c" , d -> rename_source , 0 );
1696
1697
} else {
1697
1698
struct strbuf onebuf = STRBUF_INIT ;
1698
1699
const char * one ;
1699
- if (d -> head_path ) {
1700
- one = quote_path (d -> head_path , s -> prefix , & onebuf );
1700
+
1701
+ if (d -> rename_source ) {
1702
+ one = quote_path (d -> rename_source , s -> prefix , & onebuf );
1701
1703
if (* one != '"' && strchr (one , ' ' ) != NULL ) {
1702
1704
putchar ('"' );
1703
1705
strbuf_addch (& onebuf , '"' );
@@ -2001,10 +2003,10 @@ static void wt_porcelain_v2_print_changed_entry(
2001
2003
struct wt_status * s )
2002
2004
{
2003
2005
struct wt_status_change_data * d = it -> util ;
2004
- struct strbuf buf_index = STRBUF_INIT ;
2005
- struct strbuf buf_head = STRBUF_INIT ;
2006
- const char * path_index = NULL ;
2007
- const char * path_head = NULL ;
2006
+ struct strbuf buf = STRBUF_INIT ;
2007
+ struct strbuf buf_from = STRBUF_INIT ;
2008
+ const char * path = NULL ;
2009
+ const char * path_from = NULL ;
2008
2010
char key [3 ];
2009
2011
char submodule_token [5 ];
2010
2012
char sep_char , eol_char ;
@@ -2023,8 +2025,8 @@ static void wt_porcelain_v2_print_changed_entry(
2023
2025
*/
2024
2026
sep_char = '\0' ;
2025
2027
eol_char = '\0' ;
2026
- path_index = it -> string ;
2027
- path_head = d -> head_path ;
2028
+ path = it -> string ;
2029
+ path_from = d -> rename_source ;
2028
2030
} else {
2029
2031
/*
2030
2032
* Path(s) are C-quoted if necessary. Current path is ALWAYS first.
@@ -2034,27 +2036,27 @@ static void wt_porcelain_v2_print_changed_entry(
2034
2036
*/
2035
2037
sep_char = '\t' ;
2036
2038
eol_char = '\n' ;
2037
- path_index = quote_path (it -> string , s -> prefix , & buf_index );
2038
- if (d -> head_path )
2039
- path_head = quote_path (d -> head_path , s -> prefix , & buf_head );
2039
+ path = quote_path (it -> string , s -> prefix , & buf );
2040
+ if (d -> rename_source )
2041
+ path_from = quote_path (d -> rename_source , s -> prefix , & buf_from );
2040
2042
}
2041
2043
2042
- if (path_head )
2044
+ if (path_from )
2043
2045
fprintf (s -> fp , "2 %s %s %06o %06o %06o %s %s %c%d %s%c%s%c" ,
2044
2046
key , submodule_token ,
2045
2047
d -> mode_head , d -> mode_index , d -> mode_worktree ,
2046
2048
oid_to_hex (& d -> oid_head ), oid_to_hex (& d -> oid_index ),
2047
- key [ 0 ] , d -> score ,
2048
- path_index , sep_char , path_head , eol_char );
2049
+ d -> rename_status , d -> rename_score ,
2050
+ path , sep_char , path_from , eol_char );
2049
2051
else
2050
2052
fprintf (s -> fp , "1 %s %s %06o %06o %06o %s %s %s%c" ,
2051
2053
key , submodule_token ,
2052
2054
d -> mode_head , d -> mode_index , d -> mode_worktree ,
2053
2055
oid_to_hex (& d -> oid_head ), oid_to_hex (& d -> oid_index ),
2054
- path_index , eol_char );
2056
+ path , eol_char );
2055
2057
2056
- strbuf_release (& buf_index );
2057
- strbuf_release (& buf_head );
2058
+ strbuf_release (& buf );
2059
+ strbuf_release (& buf_from );
2058
2060
}
2059
2061
2060
2062
/*
0 commit comments