Skip to content

Commit 3d9e45b

Browse files
committed
Do not push to repository if there was no change
1 parent 97826d7 commit 3d9e45b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

marge/job.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ def update_from_target_branch_and_push(
351351
start_commit='origin/' + target_branch,
352352
)
353353
branch_rewritten = True
354-
repo.push_force(source_branch, source_repo_url)
354+
source_sha = repo.get_commit_hash('source/' + source_branch)
355+
if rewritten_sha != source_sha:
356+
repo.push_force(source_branch, source_repo_url)
355357
changes_pushed = True
356358
except git.GitError:
357359
if not branch_updated:

0 commit comments

Comments
 (0)