From 2fef966708d81da7a65662675c2cb53763a32a40 Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Mon, 6 Apr 2020 09:43:37 +0200 Subject: [PATCH 1/5] fix warning: unused vars Signed-off-by: Tomas Tomecek --- src/backend.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend.rs b/src/backend.rs index 4975fe0..3542b40 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -388,7 +388,7 @@ impl Backend { pub fn get_stash_count(&mut self) -> u16 { let mut count: u16 = 0; self.repo.stash_foreach( - |u: usize, s: &str, o: &Oid| { + |_u: usize, _s: &str, _o: &Oid| { count += 1; true } From afde6a31cb35f872d5766905e786fdd6986036d5 Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Mon, 6 Apr 2020 09:43:41 +0200 Subject: [PATCH 2/5] check for result on stash_foreach Signed-off-by: Tomas Tomecek --- src/backend.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend.rs b/src/backend.rs index 3542b40..d447288 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -387,12 +387,15 @@ impl Backend { pub fn get_stash_count(&mut self) -> u16 { let mut count: u16 = 0; - self.repo.stash_foreach( + let result = self.repo.stash_foreach( |_u: usize, _s: &str, _o: &Oid| { count += 1; true } ); + if result.is_err() { + log!(self, "Unable to get stash count from the repository: {:?}", result); + } count } } From 50ff6ca96220d0b394762d22105df0833e32af7f Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Mon, 6 Apr 2020 09:43:46 +0200 Subject: [PATCH 3/5] fix warning: unused BorrowMut Signed-off-by: Tomas Tomecek --- src/backend.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/backend.rs b/src/backend.rs index d447288..c053814 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -1,7 +1,6 @@ use std::fmt; use std::collections::HashMap; use std::cell::RefCell; -use std::borrow::BorrowMut; use constants::{CHANGED_KEY,NEW_KEY,STAGED_KEY,CONFLICTS_KEY}; From 262f6419a39e2a78a270c621f1be952bb9bf661a Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Mon, 6 Apr 2020 10:15:51 +0200 Subject: [PATCH 4/5] packit yaml: use cargo to create archive Signed-off-by: Tomas Tomecek --- .packit.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index 96f5315..7660517 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -1,6 +1,6 @@ --- -specfile_path: rust-pretty-git-prompt.spec -synced_files: - - rust-pretty-git-prompt.spec - - .packit.yaml downstream_package_name: rust-pretty-git-prompt +actions: + create-archive: + - cargo publish --dry-run --allow-dirty + - bash -c "ls -1 target/package/*.crate" From bb8b71399bfe2a6ae18a85726ec635eef495e0d3 Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Mon, 6 Apr 2020 10:16:19 +0200 Subject: [PATCH 5/5] rpm spec: drop downstream patches Signed-off-by: Tomas Tomecek --- rust-pretty-git-prompt.spec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/rust-pretty-git-prompt.spec b/rust-pretty-git-prompt.spec index 69673ee..2dff002 100644 --- a/rust-pretty-git-prompt.spec +++ b/rust-pretty-git-prompt.spec @@ -11,11 +11,6 @@ Summary: Your current git repository information inside a beautiful shell License: MIT URL: https://crates.io/crates/pretty-git-prompt Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate -# Initial patched metadata -# * Bump git2 to 0.7, https://github.com/TomasTomecek/pretty-git-prompt/pull/39 -Patch0: pretty-git-prompt-0.2.0-fix-metadata.diff -# Make it work with new git2 -Patch1: 0001-deps-update-git2-to-0.7.patch ExclusiveArch: %{rust_arches}