|
|
@ -53,8 +53,8 @@ def update_git(wrap, repo_dir, options): |
|
|
|
mlog.log(' -> Not used.') |
|
|
|
mlog.log(' -> Not used.') |
|
|
|
return |
|
|
|
return |
|
|
|
revision = wrap.get('revision') |
|
|
|
revision = wrap.get('revision') |
|
|
|
ret = git_output(['rev-parse', '--abbrev-ref', 'HEAD'], repo_dir).strip() |
|
|
|
branch = git_output(['branch', '--show-current'], repo_dir).strip() |
|
|
|
if ret == 'HEAD': |
|
|
|
if branch == '': |
|
|
|
try: |
|
|
|
try: |
|
|
|
# We are currently in detached mode, just checkout the new revision |
|
|
|
# We are currently in detached mode, just checkout the new revision |
|
|
|
git_output(['fetch'], repo_dir) |
|
|
|
git_output(['fetch'], repo_dir) |
|
|
@ -65,7 +65,7 @@ def update_git(wrap, repo_dir, options): |
|
|
|
mlog.log(mlog.red(out)) |
|
|
|
mlog.log(mlog.red(out)) |
|
|
|
mlog.log(mlog.red(str(e))) |
|
|
|
mlog.log(mlog.red(str(e))) |
|
|
|
return |
|
|
|
return |
|
|
|
elif ret == revision: |
|
|
|
elif branch == revision: |
|
|
|
try: |
|
|
|
try: |
|
|
|
# We are in the same branch, pull latest commits |
|
|
|
# We are in the same branch, pull latest commits |
|
|
|
git_output(['-c', 'rebase.autoStash=true', 'pull', '--rebase'], repo_dir) |
|
|
|
git_output(['-c', 'rebase.autoStash=true', 'pull', '--rebase'], repo_dir) |
|
|
|