-
Notifications
You must be signed in to change notification settings - Fork 7
Refactor testCloneRepository function and update .gitignore #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
18c57de
209fe0a
6aa90ce
90fee20
7eb2f24
b1c5d9e
8a0a2a1
ce98ee6
448311b
366d42e
6754885
5318018
f8ae2ff
eccd922
88b1597
07a50d6
87a489c
5f9d8fc
6d68173
1a8c8b7
06a9732
46be12b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ dist | |
__pycache__ | ||
vendor | ||
.history/ | ||
.idea/ | ||
.devcontainer/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This is the current stage that you're on. | ||
# | ||
# Whenever you want to advance to the next stage, | ||
# bump this to the next number. | ||
current_stage: 1 | ||
|
||
# Set this to true if you want debug logs. | ||
# | ||
# These can be VERY verbose, so we suggest turning them off | ||
# unless you really need them. | ||
debug: true |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,13 @@ | ||||||||||||||||||||||||
#!/bin/sh | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
if [ "$1" = "init" ] | ||||||||||||||||||||||||
then | ||||||||||||||||||||||||
ein init "@$" | ||||||||||||||||||||||||
fi | ||||||||||||||||||||||||
Comment on lines
+3
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix argument handling and quoting for the
Apply this diff: -if [ "$1" = "init" ]
-then
- ein init "@$"
-fi
+if [ "$1" = "init" ]; then
+ shift
+ exec ein init "$@"
+fi 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
if [ "$1" = "cat-file" ] | ||||||||||||||||||||||||
then | ||||||||||||||||||||||||
gix cat "@$" | ||||||||||||||||||||||||
fi | ||||||||||||||||||||||||
Comment on lines
+8
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Fix argument handling and quoting in wrapper script
Proposed diff: #!/usr/bin/env sh
-if [ "$1" = "cat-file" ]
-then
- gix cat "@$"
-fi
+if [ "$1" = "cat-file" ]; then
+ shift
+ exec gix cat "$@"
+fi
exec gix "$@" 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
exec gix "$@" |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,5 +1,9 @@ | ||||||||||||||||||||
#!/bin/sh | ||||||||||||||||||||
|
||||||||||||||||||||
git config --global user.email "[email protected]" | ||||||||||||||||||||
git config --global user.name "Your Name" | ||||||||||||||||||||
Comment on lines
+3
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Avoid mutating the user's global Git config - git config --global user.email "[email protected]"
- git config --global user.name "Your Name"
- exec git "$@"
+ # Apply email/name only for this invocation, without touching ~/.gitconfig
+ exec git \
+ -c user.email="[email protected]" \
+ -c user.name="Your Name" \
+ "$@" This keeps your test setup isolated and avoids side-effects on the developer’s environment. 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||
git config --global init.defaultBranch "main" | ||||||||||||||||||||
|
||||||||||||||||||||
if [ "$1" = "write-tree" ] | ||||||||||||||||||||
then | ||||||||||||||||||||
git add . | ||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Fix error handling in deferred function and use Go's file operations
The deferred function has several issues:
Note: The
os.RemoveAll(tmpGitDir)
is already called in the earlier defer statement on line 109, so it's removed here to avoid duplication.🧰 Tools
🪛 golangci-lint (1.64.8)
197-197: Error return value is not checked
(errcheck)
🤖 Prompt for AI Agents