Skip to content
Snippets Groups Projects
Unverified Commit caa6c3ba authored by Sébastien Gaya's avatar Sébastien Gaya Committed by GitHub
Browse files

Merge pull request #642 from noesya/fix/sync-existing-remote-file

Correction de la sync d'un nouveau fichier côté Osuny mais existant côté repo
parents 1b381dda 3f194798
No related branches found
No related tags found
No related merge requests found
......@@ -9,10 +9,12 @@ class Git::Providers::Github < Git::Providers::Abstract
end
def update_file(path, previous_path, content)
file = tree_item_at_path(previous_path)
# Handle newly created GitFiles which update existing remote files while having blank previous_path.
path_to_check = previous_path.present? ? previous_path : path
file = tree_item_at_path(path_to_check)
return if file.nil?
batch << {
path: previous_path,
path: path_to_check,
mode: file[:mode],
type: file[:type],
sha: nil
......
......@@ -11,8 +11,7 @@ class Git::Providers::Gitlab < Git::Providers::Abstract
def update_file(path, previous_path, content)
file = find previous_path
return if file.nil?
if previous_path != path
if file.present? && previous_path != path
batch << {
action: 'move',
file_path: path,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment