Skip to content

Commit

Permalink
GPT-commit: Refactored 'git add .' in 'Wgit' class to handle multiple…
Browse files Browse the repository at this point in the history
… calls.

Refactored `git add` in `wgit` class for consistency.
  • Loading branch information
hwixley committed Jun 30, 2024
1 parent 33ad150 commit c2795fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/classes/wgit/wgit.class
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ wgit.wyx_ginit(){
}

wgit.commit() {
git add .
if sys.util.empty "$1" ; then
if [ -f "${WYX_DATA_DIR}/.env" ]; then
if grep -q "OPENAI_API_KEY=" "${WYX_DATA_DIR}/.env" && grep -q "USE_SMART_COMMIT=true" "${WYX_DATA_DIR}/.env" ; then
Expand All @@ -101,14 +100,17 @@ wgit.commit() {
else
sys.log.info "Provide a commit description: (defaults to 'wyx-cli quick commit')"
read -r description
git add .
git commit -m "${description:-wyx-cli quick commit}"
fi
else
sys.log.info "Provide a commit description: (defaults to 'wyx-cli quick commit')"
read -r description
git add .
git commit -m "${description:-wyx-cli quick commit}"
fi
else
git add .
git commit -m "${1:-wyx-cli quick commit}"
fi
}
Expand Down

0 comments on commit c2795fd

Please sign in to comment.