History

fix: `gix clone` now handles empty repositories. (#792)

Previously it would panic as the case was unexpected, now it prints a message informing about the empty repository similar to how git does.

Sebastian Thiel committed 3 years ago

Commit 32cfeac1 parent 5dc1f9f1 file · +1 −1Browse files

Unified · Split

gitoxide-core/src/repository/clone.rs+1−1
@@ -86,7 +86,7 @@ pub(crate) mod function { · 85 unmodified lines
86 86
87 match fetch_outcome.status {87 match fetch_outcome.status {
88 Status::NoPackReceived { .. } => {88 Status::NoPackReceived { .. } => {
89 unreachable!("clone always has changes")89 writeln!(err, "The cloned repository appears to be empty")?;
90 }90 }
91 Status::DryRun { .. } => unreachable!("dry-run unsupported"),91 Status::DryRun { .. } => unreachable!("dry-run unsupported"),
92 Status::Change { update_refs, .. } => {92 Status::Change { update_refs, .. } => {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t