threads / patch / 33412

patchformat-patch: trivial cleanup

Subject: [PATCH] format-patch: trivial cleanup

## tl;dr

2 messages between Apr 7, 2013 and Apr 7, 2013. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Felipe Contreras· Apr 7, 2013, 07:18 UTC · lore
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
Actually, now that we are on it. After applying my latest patch series, this makes sense.
 builtin/log.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
Show changes to builtin/log.c +3 −5
diff --git a/builtin/log.c b/builtin/log.c
index fab7998..7cf9277 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1058,12 +1058,10 @@ static char *find_branch_name(struct rev_info *rev)
 		else
 			return NULL;
 	}
-	if (0 <= positive) {
-		ref = rev->cmdline.rev[positive].name;
-		tip_sha1 = rev->cmdline.rev[positive].item->sha1;
-	} else {
+	if (positive < 0)
 		return NULL;
-	}
+	ref = rev->cmdline.rev[positive].name;
+	tip_sha1 = rev->cmdline.rev[positive].item->sha1;
 	if (dwim_ref(ref, strlen(ref), branch_sha1, &full_ref) &&
 	    !prefixcmp(full_ref, "refs/heads/") &&
 	    !hashcmp(tip_sha1, branch_sha1))
-- 
1.8.2
Junio C Hamano· Apr 7, 2013, 08:16 UTC · re: Felipe Contreras · lore

Re: [PATCH] format-patch: trivial cleanup

Felipe Contreras <felipe.contreras@gmail.com> writes:
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>
> Actually, now that we are on it. After applying my latest patch series, this makes sense.
Yes, this is way easier to read.
Show 24 quoted lines
>
>  builtin/log.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/builtin/log.c b/builtin/log.c
> index fab7998..7cf9277 100644
> --- a/builtin/log.c
> +++ b/builtin/log.c
> @@ -1058,12 +1058,10 @@ static char *find_branch_name(struct rev_info *rev)
>  		else
>  			return NULL;
>  	}
> -	if (0 <= positive) {
> -		ref = rev->cmdline.rev[positive].name;
> -		tip_sha1 = rev->cmdline.rev[positive].item->sha1;
> -	} else {
> +	if (positive < 0)
>  		return NULL;
> -	}
> +	ref = rev->cmdline.rev[positive].name;
> +	tip_sha1 = rev->cmdline.rev[positive].item->sha1;
>  	if (dwim_ref(ref, strlen(ref), branch_sha1, &full_ref) &&
>  	    !prefixcmp(full_ref, "refs/heads/") &&
>  	    !hashcmp(tip_sha1, branch_sha1))

← back to recent threads