From aedbd0949784aeec1c77679d5165a761df53bbbf Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 12 Jun 2019 15:53:10 +0200 Subject: [PATCH] [DEV] add git push command --- island/commands.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/island/commands.py b/island/commands.py index 9b9042f..28e1798 100644 --- a/island/commands.py +++ b/island/commands.py @@ -249,3 +249,17 @@ def fetch(path_repository, remote_name): return_value = multiprocess.run_command(cmd, cwd=path_repository) generic_display_error(return_value, "fetch") return return_value + +def push(path_repository, remote_name, elements): + if remote_name == None or remote_name == "": + raise "Missing remote_name" + if len(elements) == 0: + raise "No elements to push on server" + + cmd = 'git push ' + remote_name + for elem in elements: + cmd += " " + elem + debug.verbose("execute : " + cmd) + return_value = multiprocess.run_command(cmd, cwd=path_repository) + generic_display_error(return_value, "push") + return return_value \ No newline at end of file