mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
20 lines
541 B
Plaintext
Executable file
20 lines
541 B
Plaintext
Executable file
# put all utility functions here
|
|
|
|
# make a temporary file
|
|
git_extra_mktemp() {
|
|
mktemp -t "$(basename "$0")".XXXXXXX
|
|
}
|
|
|
|
git_extra_default_branch() {
|
|
local extras_default_branch init_default_branch
|
|
extras_default_branch=$(git config --get git-extras.default-branch)
|
|
init_default_branch=$(git config --get init.defaultBranch)
|
|
if [ -n "$extras_default_branch" ]; then
|
|
echo "$extras_default_branch"
|
|
elif [ -n "$init_default_branch" ]; then
|
|
echo "$init_default_branch"
|
|
else
|
|
echo "main"
|
|
fi
|
|
}
|