From patchwork Mon Feb 12 01:13:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Donnellan X-Patchwork-Id: 871836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zfnkh4Mncz9t2l for ; Mon, 12 Feb 2018 12:14:20 +1100 (AEDT) Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zfnkh3L85zF0jt for ; Mon, 12 Feb 2018 12:14:20 +1100 (AEDT) X-Original-To: snowpatch@lists.ozlabs.org Delivered-To: snowpatch@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=au1.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=andrew.donnellan@au1.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zfnkb68YgzF0jN for ; Mon, 12 Feb 2018 12:14:12 +1100 (AEDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1C19ERP103599 for ; Sun, 11 Feb 2018 20:14:09 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2g2fa3q66m-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 11 Feb 2018 20:14:09 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Feb 2018 01:14:08 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 12 Feb 2018 01:14:06 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1C1E60V49545318; Mon, 12 Feb 2018 01:14:06 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8C8EDAE053; Mon, 12 Feb 2018 01:05:12 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3AE8CAE04D; Mon, 12 Feb 2018 01:05:12 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 12 Feb 2018 01:05:12 +0000 (GMT) Received: from intelligence.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 848D0A0265; Mon, 12 Feb 2018 12:14:04 +1100 (AEDT) From: Andrew Donnellan To: snowpatch@lists.ozlabs.org Date: Mon, 12 Feb 2018 12:13:51 +1100 X-Mailer: git-send-email 2.11.0 X-TM-AS-GCONF: 00 x-cbid: 18021201-0040-0000-0000-0000040EA952 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021201-0041-0000-0000-0000261265F3 Message-Id: <20180212011351.25201-1-andrew.donnellan@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-11_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802120013 Subject: [snowpatch] [PATCH] Use up-to-date commit ID when creating new test branch X-BeenThere: snowpatch@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Continuous Integration for patch-based workflows List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: snowpatch-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "snowpatch" When we create a new test branch, we use a commit ID taken from before we've pulled the latest upstream branch. Move the fetching of the current commit ID until after we've pulled. Signed-off-by: Andrew Donnellan --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index a31c8846568a..a7f90f95a517 100644 --- a/src/main.rs +++ b/src/main.rs @@ -165,7 +165,6 @@ fn test_patch(settings: &Config, client: &Arc, project: &Project, let tag = utils::sanitise_path( path.file_name().unwrap().to_str().unwrap().to_string()); let mut remote = repo.find_remote(&project.remote_name).unwrap(); - let commit = git::get_latest_commit(&repo); let mut push_callbacks = RemoteCallbacks::new(); push_callbacks.credentials(|_, _, _| { @@ -186,6 +185,7 @@ fn test_patch(settings: &Config, client: &Arc, project: &Project, git::pull(&repo).unwrap(); debug!("Creating a new branch..."); + let commit = git::get_latest_commit(&repo); let mut branch = repo.branch(&tag, &commit, true).unwrap(); debug!("Switching to branch..."); repo.set_head(branch.get().name().unwrap())