Re: [PATCH v5 3/8] branch: roll show_detached HEAD into regular ref_list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Karthik Nayak <karthik.188@xxxxxxxxx> writes:

> @@ -681,14 +684,12 @@ static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru
>  
>  	qsort(ref_list.list, ref_list.index, sizeof(struct ref_item), ref_cmp);
>  
> -	detached = (detached && (kinds & REF_LOCAL_BRANCH));
> -	if (detached && match_patterns(pattern, "HEAD"))
> -		show_detached(&ref_list, maxwidth);
> -
>  	for (i = 0; i < ref_list.index; i++) {
> -		int current = !detached &&
> -			(ref_list.list[i].kind == REF_LOCAL_BRANCH) &&
> +		int current = !detached && (ref_list.list[i].kind == REF_LOCAL_BRANCH) &&
>  			!strcmp(ref_list.list[i].name, head);
> +		/*  If detached the first ref_item is the current ref */

This relies on the fact that sorting (qsort above) did not move HEAD
from its first position. This is OK, as we don't have a --sort option
yet. Good.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]