Skip to content

Commit f62f23d

Browse files
committed
Fix warnings
1 parent a989fb9 commit f62f23d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

git-compare-cherried

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ HEAD=$2
1414
echo "Analyzing commits between $UPSTREAM and $HEAD..."
1515

1616
# Get commits that are in HEAD but not in UPSTREAM (similar to git cherry)
17-
UNIQUE_COMMITS=$(git rev-list $UPSTREAM..$HEAD)
17+
UNIQUE_COMMITS=$(git rev-list "$UPSTREAM".."$HEAD")
1818

1919
if [ -z "$UNIQUE_COMMITS" ]; then
2020
echo "No unique commits found in $HEAD that aren't in $UPSTREAM."
2121
exit 0
2222
fi
2323

2424
# Get all commit messages from upstream for comparison
25-
UPSTREAM_MSGS=$(git log --format="%s" $UPSTREAM)
25+
UPSTREAM_MSGS=$(git log --format="%s" "$UPSTREAM")
2626

2727
echo "Commits in $HEAD that aren't in $UPSTREAM based on commit message:"
2828
echo "--------------------------------------------------------------"
2929

3030
while IFS= read -r commit; do
3131
# Get the commit message for this commit
32-
COMMIT_MSG=$(git log -n 1 --format="%s" $commit)
32+
COMMIT_MSG=$(git log -n 1 --format="%s" "$commit")
3333

3434
# Check if this commit message exists in upstream
3535
if ! echo "$UPSTREAM_MSGS" | grep -q "^$COMMIT_MSG$"; then
3636
# This commit message doesn't exist in upstream, so show it
37-
git show --no-patch --format="%C(yellow)%h%C(reset) - %s %C(green)(%cr) %C(bold blue)<%an>%C(reset)" $commit
37+
git show --no-patch --format="%C(yellow)%h%C(reset) - %s %C(green)(%cr) %C(bold blue)<%an>%C(reset)" "$commit"
3838
fi
3939
done <<< "$UNIQUE_COMMITS"

0 commit comments

Comments
 (0)