In Git2 error fixing, opening the repo is still currently unavailable.
This commit is contained in:
@@ -64,7 +64,7 @@ pub struct ChangelogCommand {
|
||||
|
||||
impl ChangelogCommand {
|
||||
pub async fn execute(&self) -> Result<()> {
|
||||
let repo = find_repo(".")?;
|
||||
let repo = find_repo(std::env::current_dir()?.as_path())?;
|
||||
let manager = ConfigManager::new()?;
|
||||
let config = manager.config();
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ pub struct CommitCommand {
|
||||
impl CommitCommand {
|
||||
pub async fn execute(&self) -> Result<()> {
|
||||
// Find git repository
|
||||
let repo = find_repo(".")?;
|
||||
let repo = find_repo(std::env::current_dir()?.as_path())?;
|
||||
|
||||
// Check for changes
|
||||
let status = repo.status_summary()?;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use anyhow::{bail, Context, Result};
|
||||
use anyhow::{bail, Result};
|
||||
use clap::{Parser, Subcommand};
|
||||
use colored::Colorize;
|
||||
use dialoguer::{Confirm, Input, Select};
|
||||
|
||||
use crate::config::manager::ConfigManager;
|
||||
use crate::config::{CommitFormat, LlmConfig};
|
||||
use crate::config::CommitFormat;
|
||||
|
||||
/// Mask API key with asterisks for security
|
||||
fn mask_api_key(key: Option<&str>) -> String {
|
||||
@@ -821,9 +821,16 @@ impl ConfigCommand {
|
||||
if client.is_available().await {
|
||||
println!("{} LLM connection successful!", "✓".green());
|
||||
|
||||
// Test generation
|
||||
// Test generation with a sample diff
|
||||
println!("Testing generation...");
|
||||
match client.generate_commit_message("test", crate::config::CommitFormat::Conventional).await {
|
||||
let sample_diff = r#"diff --git a/src/main.rs b/src/main.rs
|
||||
--- a/src/main.rs
|
||||
+++ b/src/main.rs
|
||||
@@ -1,3 +1,4 @@
|
||||
fn main() {
|
||||
+ println!("Hello, World!");
|
||||
}"#;
|
||||
match client.generate_commit_message(sample_diff, crate::config::CommitFormat::Conventional).await {
|
||||
Ok(response) => {
|
||||
println!("{} Generation test passed", "✓".green());
|
||||
println!("Response: {}", response.description.dimmed());
|
||||
|
||||
@@ -352,7 +352,7 @@ impl ProfileCommand {
|
||||
|
||||
async fn set_repo(&self, name: &str) -> Result<()> {
|
||||
let mut manager = ConfigManager::new()?;
|
||||
let repo = find_repo(".")?;
|
||||
let repo = find_repo(std::env::current_dir()?.as_path())?;
|
||||
|
||||
let repo_path = repo.path().to_string_lossy().to_string();
|
||||
|
||||
@@ -381,7 +381,7 @@ impl ProfileCommand {
|
||||
profile.apply_global()?;
|
||||
println!("{} Applied profile '{}' globally", "✓".green(), profile.name.cyan());
|
||||
} else {
|
||||
let repo = find_repo(".")?;
|
||||
let repo = find_repo(std::env::current_dir()?.as_path())?;
|
||||
profile.apply_to_repo(repo.inner())?;
|
||||
println!("{} Applied profile '{}' to current repository", "✓".green(), profile.name.cyan());
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ pub struct TagCommand {
|
||||
|
||||
impl TagCommand {
|
||||
pub async fn execute(&self) -> Result<()> {
|
||||
let repo = find_repo(".")?;
|
||||
let repo = find_repo(std::env::current_dir()?.as_path())?;
|
||||
let manager = ConfigManager::new()?;
|
||||
let config = manager.config();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user