Unverified Commit 1ebb5dd7 authored by Saverio Miroddi's avatar Saverio Miroddi Committed by Dennis Schubert

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
parent f8ce276d
# 0.7.4.0
## Refactor
* Don't print a warning when starting the server outside a Git repo [#7712](https://github.com/diaspora/diaspora/pull/7712)
## Bug fixes
......
......@@ -63,16 +63,20 @@ fi
command -v git > /dev/null 2>&1
if [ $? -eq 0 ]; then
# 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" ];
# Check if we're in a repository, before doing any verification.
if git status > /dev/null 2>&1;
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment