| ... | @@ -8,13 +8,13 @@ module Gitlab |
... | @@ -8,13 +8,13 @@ module Gitlab |
|
|
#
|
|
#
|
|
|
# Returns false if the ref has been updated while editing the file
|
|
# Returns false if the ref has been updated while editing the file
|
|
|
# Returns false if committing the change fails
|
|
# Returns false if committing the change fails
|
|
|
# Returns false if pushing from the satellite to Gitolite failed or was rejected
|
|
# Returns false if pushing from the satellite to bare repo failed or was rejected
|
|
|
# Returns true otherwise
|
|
# Returns true otherwise
|
|
|
def commit!(content, commit_message)
|
|
def commit!(content, commit_message)
|
|
|
in_locked_and_timed_satellite do |repo|
|
|
in_locked_and_timed_satellite do |repo|
|
|
|
prepare_satellite!(repo)
|
|
prepare_satellite!(repo)
|
|
|
|
|
|
|
|
# create target branch in satellite at the corresponding commit from Gitolite
|
|
# create target branch in satellite at the corresponding commit from bare repo
|
|
|
repo.git.checkout({raise: true, timeout: true, b: true}, ref, "origin/#{ref}")
|
|
repo.git.checkout({raise: true, timeout: true, b: true}, ref, "origin/#{ref}")
|
|
|
|
|
|
|
|
# update the file in the satellite's working dir
|
|
# update the file in the satellite's working dir
|
| ... | @@ -26,7 +26,7 @@ module Gitlab |
... | @@ -26,7 +26,7 @@ module Gitlab |
|
|
repo.git.commit(raise: true, timeout: true, a: true, m: commit_message)
|
|
repo.git.commit(raise: true, timeout: true, a: true, m: commit_message)
|
|
|
|
|
|
|
|
|
|
|
|
|
# push commit back to Gitolite
|
|
# push commit back to bare repo
|
|
|
# will raise CommandFailed when push fails
|
|
# will raise CommandFailed when push fails
|
|
|
repo.git.push({raise: true, timeout: true}, :origin, ref)
|
|
repo.git.push({raise: true, timeout: true}, :origin, ref)
|
|
|
|
|
|
| ... | |
... | |
| ... | | ... | |