Re: [PATCH v3] Add push --set-upstream

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

 



Hi,

On Sat, 16 Jan 2010 15:46:57 +0200
Ilari Liusvaara <ilari.liusvaara@xxxxxxxxxxx> wrote:

> > Regarding the checking of ref->status here:
> > 
> > Is it possible to delegate this to push_had_errors(remote_refs)
> > instead? We skip setting up upstream tracking when there are errors
> > from pushing, so we don't have to check ref->status anymore.
> 
> No. As documetnation says, the update or no update is done on per-branch
> basis.
> 
> <snip patch>

I see. If that's the case, could you also allow setting up upstream
tracking when ref->status is 'none' and not consider it errorneous?

After all, push_had_errors() does not consider 'none' errorneous.

I think a switch block might be neater too.

@@ -149,9 +149,15 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
		 * Check suitability for tracking. Must be successful /
		 * already up-to-date ref create/modify (not delete).
		 */
-		if (ref->status != REF_STATUS_OK &&
-			ref->status != REF_STATUS_UPTODATE)
+		switch (ref->status) {
+		case REF_STATUS_NONE:
+		case REF_STATUS_UPTODATE:
+		case REF_STATUS_OK:
+			; /* no-op */
+		default:
			continue;
+		}
		if (!ref->peer_ref)
			continue;
		if (!ref->new_sha1 || is_null_sha1(ref->new_sha1))


-- 
Cheers,
Ray Chuan
--
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]