mirror of
https://github.com/git-quick-stats/git-quick-stats.git
synced 2025-12-16 12:00:12 +01:00
* When running "make test" in the root directory of this codebase, an error will occur as this shell script requires a repo to be initialized before it can properly execute. This was done in the past, but at some point, it was removed. This adds the feature back, tests if we are in a git directory by using a built-in git command, and only performs this action if a git repo doesn't already exist. All actions are sent to /dev/null so the testing should look opaque to the end user. Note that tests will still fail if a user is missing a required utility to perform the functionality of git-quick-stats. * Fixed a typo in the man page Fixes #162
17 lines
741 B
Bash
Executable File
17 lines
741 B
Bash
Executable File
#!/bin/sh
|
|
# Initialises a new local Git repo for test purpose if one does not exist already
|
|
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
{
|
|
git init
|
|
git config user.name "$(printf %s 'Test Git,\nfor test purpose')"
|
|
git config user.email "TestGit\o/@example.org"
|
|
|
|
printf 'test-git\n========\n' > README.md
|
|
git add README.md
|
|
git commit -m 'added readme (o\w/o)' -m 'in markdown, no \r\n, only \n' -m 'a very "simple" readme'
|
|
testChars="$(printf 'tab [%b] form feed [%b] line feed [%b] carriage return [%b]' '\x09' '\x0C' '\x0A' '\x0D')"
|
|
git notes add -m 'Some notes' -m 'out of ascii: été au cœur' -m "$testChars"
|
|
git log
|
|
} >/dev/null 2>&1
|
|
fi
|