bugfix: only abort merge when is needed #70
@@ -79,7 +79,9 @@ def check_merge_conflicts(target: str):
|
|||||||
print="Realizando merge de prueba para verificar conflictos"
|
print="Realizando merge de prueba para verificar conflictos"
|
||||||
)
|
)
|
||||||
|
|
||||||
Git("merge", abort=True).exec(print="Abortando merge de prueba", check=False)
|
# Si el merge no llegó a realizarse (por ejemplo, "Already up to date") no hay nada que abortar
|
||||||
|
if Git.is_merging():
|
||||||
|
Git("merge", abort=True).exec(print="Abortando merge de prueba")
|
||||||
|
|
||||||
if merge_conflicts:
|
if merge_conflicts:
|
||||||
base.io_error(
|
base.io_error(
|
||||||
|
|||||||
@@ -63,6 +63,11 @@ class Git:
|
|||||||
def get_branches(prefix: str = ""):
|
def get_branches(prefix: str = ""):
|
||||||
return Git._get_references("heads/" + prefix)
|
return Git._get_references("heads/" + prefix)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def is_merging() -> bool:
|
||||||
|
"""Indica si hay un merge en curso (existe MERGE_HEAD), con o sin conflictos."""
|
||||||
|
return Git("rev-parse", "MERGE_HEAD", quiet=True, verify=True).code() == 0
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def status():
|
def status():
|
||||||
return list(map(Git.Status, Git("status", porcelain=True).lines(False)))
|
return list(map(Git.Status, Git("status", porcelain=True).lines(False)))
|
||||||
|
|||||||
Reference in New Issue
Block a user