[snowpatch] [PATCH] Use up-to-date commit ID when creating new test branch

Andrew Donnellan andrew.donnellan at au1.ibm.com
Mon Feb 12 12:13:51 AEDT 2018


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 <andrew.donnellan at au1.ibm.com>
---
 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<Client>, 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<Client>, 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())
-- 
2.11.0



More information about the snowpatch mailing list