mirror of
https://github.com/msfjarvis/gitice
synced 2025-08-14 11:47:01 +05:30
search: skip empty repos
Signed-off-by: ATechnoHazard <amolele@gmail.com>
This commit is contained in:
parent
f0da001acb
commit
8d261ee9fd
1 changed files with 6 additions and 1 deletions
|
@ -16,10 +16,15 @@ fn main() -> anyhow::Result<()> {
|
||||||
let path = format!("{}/.git", entry.path().display());
|
let path = format!("{}/.git", entry.path().display());
|
||||||
let git_dir = Path::new(&path);
|
let git_dir = Path::new(&path);
|
||||||
if git_dir.exists() {
|
if git_dir.exists() {
|
||||||
|
let repo = Repository::open(git_dir)?;
|
||||||
|
if repo.is_empty()? {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
items.push(format!(
|
items.push(format!(
|
||||||
"{} = {}",
|
"{} = {}",
|
||||||
entry.path().to_string_lossy().to_string(),
|
entry.path().to_string_lossy().to_string(),
|
||||||
Repository::open(git_dir)?.head()?.name().unwrap_or("None")
|
repo.head()?.name().unwrap_or("None")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue