Final fix for git safe directory
This commit is contained in:
@@ -3,6 +3,7 @@ import os
|
|||||||
|
|
||||||
from sh import ErrorReturnCode, git
|
from sh import ErrorReturnCode, git
|
||||||
from wo.core.logging import Log
|
from wo.core.logging import Log
|
||||||
|
from wo.core.fileutils import WOFileUtils
|
||||||
|
|
||||||
|
|
||||||
class WOGit:
|
class WOGit:
|
||||||
@@ -29,8 +30,10 @@ class WOGit:
|
|||||||
Log.debug(self, "{0}".format(e))
|
Log.debug(self, "{0}".format(e))
|
||||||
Log.error(self, "Unable to git init at {0}"
|
Log.error(self, "Unable to git init at {0}"
|
||||||
.format(path))
|
.format(path))
|
||||||
git.config("--global", "--add", "safe.directory",
|
if not WOFileUtils.grep("/root/.gitconfig",
|
||||||
"{0}".format(path))
|
"{0}".format(path)):
|
||||||
|
git.config("--global", "--add", "safe.directory",
|
||||||
|
"{0}".format(path))
|
||||||
status = wogit.status("-s")
|
status = wogit.status("-s")
|
||||||
if len(status.splitlines()) > 0:
|
if len(status.splitlines()) > 0:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user