Minor renaming

This commit is contained in:
Patrick Lühne 2018-09-17 17:15:14 +02:00
parent be2e15384b
commit 19c51dc358
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -232,14 +232,14 @@ impl BenchmarkRepository
pub fn commit_file(&self, file_path: &Path, result_file_path: &Path, branch_name: &str) pub fn commit_file(&self, file_path: &Path, result_file_path: &Path, branch_name: &str)
{ {
let reference_name = format!("refs/remotes/origin/{}", branch_name); let tip_reference_name = format!("refs/remotes/origin/{}", branch_name);
let reference = match self.repository.find_reference(&reference_name) let tip_reference = match self.repository.find_reference(&tip_reference_name)
{ {
Ok(value) => value, Ok(value) => value,
Err(error) => panic!("Could not find reference “{}”: {}", reference_name, error), Err(error) => panic!("Could not find reference “{}”: {}", tip_reference_name, error),
}; };
let parent_tree = match reference.peel_to_tree() let parent_tree = match tip_reference.peel_to_tree()
{ {
Ok(value) => value, Ok(value) => value,
Err(error) => panic!("Could not peel reference to tree: {}", error), Err(error) => panic!("Could not peel reference to tree: {}", error),
@ -281,13 +281,13 @@ impl BenchmarkRepository
let signature = Signature::now(&self.user_name, &self.user_email).expect("Could not create signature"); let signature = Signature::now(&self.user_name, &self.user_email).expect("Could not create signature");
let message = format!("Add file “{}", result_file_path.display()); let message = format!("Add file “{}", result_file_path.display());
let parent = match reference.peel_to_commit() let parent = match tip_reference.peel_to_commit()
{ {
Ok(value) => value, Ok(value) => value,
Err(error) => panic!("Could not peel reference: {}", error), Err(error) => panic!("Could not peel reference: {}", error),
}; };
let commit_id = match self.repository.commit(Some(&reference_name), &signature, &signature, &message, &tree, &[&parent]) let commit_id = match self.repository.commit(Some(&tip_reference_name), &signature, &signature, &message, &tree, &[&parent])
{ {
Ok(value) => value, Ok(value) => value,
Err(error) => panic!("Could not write commit: {}", error), Err(error) => panic!("Could not write commit: {}", error),
@ -303,7 +303,7 @@ impl BenchmarkRepository
{ {
match Cred::ssh_key_from_agent(&self.ssh_user) match Cred::ssh_key_from_agent(&self.ssh_user)
{ {
Ok(credentials) => Ok(credentials), Ok(value) => Ok(value),
Err(error) => panic!("could not retrieve key pair for SSH authentication as user “{}”: {}", self.ssh_user, error), Err(error) => panic!("could not retrieve key pair for SSH authentication as user “{}”: {}", self.ssh_user, error),
} }
}); });