Karthik Nayak <karthik....@gmail.com> 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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to