...
This commit is contained in:
@@ -76,7 +76,11 @@ pub fn (mut gitstructure GitStructure) repo_new_from_gitlocation(git_location Gi
|
||||
// Commit the staged changes with the provided commit message.
|
||||
pub fn (mut repo GitRepo) commit(msg string) ! {
|
||||
repo.status_update()!
|
||||
if repo.need_commit()! {
|
||||
if !repo.need_commit()! {
|
||||
console.print_debug('No changes to commit.')
|
||||
return
|
||||
}
|
||||
|
||||
if msg == '' {
|
||||
return error('Commit message is empty.')
|
||||
}
|
||||
@@ -89,9 +93,6 @@ pub fn (mut repo GitRepo) commit(msg string) ! {
|
||||
}
|
||||
console.print_green('Changes committed successfully.')
|
||||
repo.load()!
|
||||
} else {
|
||||
console.print_debug('No changes to commit.')
|
||||
}
|
||||
}
|
||||
|
||||
// Push local changes to the remote repository.
|
||||
|
||||
Reference in New Issue
Block a user