Don't print a warning when starting the server outside a Git repo
Currently, git checks are performed on server start, even when outside a git repository. This commit verify the presence of a git repository (via `git status` exit code), and perform checks only if it exists. closes #7712
This commit is contained in:
parent
f8ce276ddc
commit
1ebb5dd72d
2 changed files with 14 additions and 9 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
# 0.7.4.0
|
# 0.7.4.0
|
||||||
|
|
||||||
## Refactor
|
## Refactor
|
||||||
|
* Don't print a warning when starting the server outside a Git repo [#7712](https://github.com/diaspora/diaspora/pull/7712)
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,16 +63,20 @@ fi
|
||||||
|
|
||||||
command -v git > /dev/null 2>&1
|
command -v git > /dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
# Check if git merge is in progress
|
# Check if we're in a repository, before doing any verification.
|
||||||
if [ -f .git/MERGE_MODE ]; then
|
if git status > /dev/null 2>&1;
|
||||||
fatal "A git merge is in progress!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if detached head state
|
|
||||||
git_branch_name="$(git symbolic-ref HEAD 2>/dev/null)"
|
|
||||||
if [ -z "$git_branch_name" ];
|
|
||||||
then
|
then
|
||||||
warning "You are in detached HEAD state!"
|
# Check if git merge is in progress
|
||||||
|
if [ -f .git/MERGE_MODE ]; then
|
||||||
|
fatal "A git merge is in progress!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if detached head state
|
||||||
|
git_branch_name="$(git symbolic-ref HEAD 2>/dev/null)"
|
||||||
|
if [ -z "$git_branch_name" ];
|
||||||
|
then
|
||||||
|
warning "You are in detached HEAD state!"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue