@@ -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())
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@au1.ibm.com> --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)