mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 15:08:51 +00:00
BlenderBIM IFC Git set push.autoSetupRemote
When pushing to a remote repository set tracking for the current branch so that a locally created repository behaves the same (on the command-line) as a cloned repository
This commit is contained in:
@@ -132,6 +132,7 @@ class IfcGit:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def push(cls, repo, remote_name, branch_name):
|
def push(cls, repo, remote_name, branch_name):
|
||||||
|
cls.config_push(repo)
|
||||||
remote = repo.remotes[remote_name]
|
remote = repo.remotes[remote_name]
|
||||||
try:
|
try:
|
||||||
remote.push(tags=True, refspec=branch_name).raise_if_error()
|
remote.push(tags=True, refspec=branch_name).raise_if_error()
|
||||||
@@ -423,6 +424,15 @@ class IfcGit:
|
|||||||
config_writer.set_value(section, "cmd", "ifcmerge $BASE $REMOTE $LOCAL $MERGED")
|
config_writer.set_value(section, "cmd", "ifcmerge $BASE $REMOTE $LOCAL $MERGED")
|
||||||
config_writer.set_value(section, "trustExitCode", True)
|
config_writer.set_value(section, "trustExitCode", True)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def config_push(cls, repo):
|
||||||
|
"""Set push.autoSetupRemote"""
|
||||||
|
config_reader = repo.config_reader()
|
||||||
|
config_writer = repo.config_writer()
|
||||||
|
if not config_reader.has_section("push"):
|
||||||
|
config_writer.set_value("push", "default", "current")
|
||||||
|
config_writer.set_value("push", "autoSetupRemote", True)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def config_info_attributes(cls, repo):
|
def config_info_attributes(cls, repo):
|
||||||
"""Set IFC files as text in .git/info/attributes"""
|
"""Set IFC files as text in .git/info/attributes"""
|
||||||
|
|||||||
Reference in New Issue
Block a user