Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions crates/git-branch-stash/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl RepoConfig {
let default_config = match git2::Config::open_default() {
Ok(config) => Some(config),
Err(err) => {
log::debug!("Failed to load git config: {}", err);
log::debug!("Failed to load git config: {err}");
None
}
};
Expand All @@ -40,7 +40,7 @@ impl RepoConfig {
match git2::Config::open(&config_path) {
Ok(config) => Ok(Self::from_gitconfig(&config)),
Err(err) => {
log::debug!("Failed to load git config: {}", err);
log::debug!("Failed to load git config: {err}");
Ok(Default::default())
}
}
Expand All @@ -59,7 +59,7 @@ impl RepoConfig {
match git2::Config::open(&config_path) {
Ok(config) => Ok(Self::from_gitconfig(&config)),
Err(err) => {
log::debug!("Failed to load git config: {}", err);
log::debug!("Failed to load git config: {err}");
Ok(Default::default())
}
}
Expand Down Expand Up @@ -88,7 +88,7 @@ impl RepoConfig {
let mut config = Self::default();

for (key, value) in iter {
log::trace!("Env config: {}={:?}", key, value);
log::trace!("Env config: {key}={value:?}");
if key == PROTECTED_STACK_FIELD {
if let Some(value) = value {
config
Expand All @@ -115,7 +115,7 @@ impl RepoConfig {
let config = match git2::Config::open_default() {
Ok(config) => Some(config),
Err(err) => {
log::debug!("Failed to load git config: {}", err);
log::debug!("Failed to load git config: {err}");
None
}
};
Expand Down
4 changes: 2 additions & 2 deletions crates/git-branch-stash/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ impl Snapshot {

for (_old_id, new_id, name) in &planned_changes {
if head_branch_name == Some(name) {
log::debug!("Restoring {} (HEAD)", name);
log::debug!("Restoring {name} (HEAD)");
repo.detach()?;
repo.branch(name, *new_id)?;
repo.switch(name)?;
} else {
log::debug!("Restoring {}", name);
log::debug!("Restoring {name}");
repo.branch(name, *new_id)?;
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/git-branch-stash/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl Stack {
let len = elems.len();
if capacity < len {
let remove = len - capacity;
log::debug!("Too many snapshots, clearing {} oldest", remove);
log::debug!("Too many snapshots, clearing {remove} oldest");
for snapshot_path in &elems[0..remove] {
if let Err(err) = std::fs::remove_file(snapshot_path) {
log::debug!("Failed to remove {}: {}", snapshot_path.display(), err);
Expand Down
12 changes: 4 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,11 @@ fn stash_push(repo: &mut git_branch_stash::GitRepo, context: &str) -> Option<git

match stash_id {
Ok(stash_id) => {
log::info!(
"Saved working directory and index state {}: {}",
stash_msg,
stash_id
);
log::info!("Saved working directory and index state {stash_msg}: {stash_id}");
Some(stash_id)
}
Err(err) => {
log::debug!("Failed to stash: {}", err);
log::debug!("Failed to stash: {err}");
None
}
}
Expand All @@ -304,10 +300,10 @@ fn stash_pop(repo: &mut git_branch_stash::GitRepo, stash_id: Option<git2::Oid>)

match repo.raw_mut().stash_pop(index, None) {
Ok(()) => {
log::info!("Dropped refs/stash {}", stash_id);
log::info!("Dropped refs/stash {stash_id}");
}
Err(err) => {
log::error!("Failed to pop {} from stash: {}", stash_id, err);
log::error!("Failed to pop {stash_id} from stash: {err}");
}
}
}
Expand Down
Loading