Skip to content

Commit

Permalink
Solve the issue of uploading files with spaces.
Browse files Browse the repository at this point in the history
re #6176
  • Loading branch information
gesnerpassos committed Apr 24, 2013
1 parent e2c7ae9 commit f3a4abe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scriptrepository/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def publish(req, author="", mail="", comment="", path="", file="", repo = ""):
os.chdir(REPOSITORYPATH)
relative_path = os.path.relpath(file_path, REPOSITORYPATH)

__shell_execute("git add " + relative_path)
__shell_execute("""git add "%s" """ %(relative_path))

__shell_execute("""git commit -m '%s' --author "%s" """%(comment, author + " <" + mail+">"))

Expand All @@ -119,7 +119,11 @@ def publish(req, author="", mail="", comment="", path="", file="", repo = ""):
except GitExceptions, ex:
info['shell'] = ex.cmd
info['detail'] = str(ex)
info['message'] = "Failed to Upload" # fixme
if ('nothing added to commit' in str(ex) or
'nothing to commit' in str(ex)):
info['message'] = "success"
else:
info['message'] = "Failed to Upload.\n You may turn on the information level of logging and try again to see why it failed."
#recover the status
__shell_execute("git reset --hard origin/master")
except :
Expand Down

0 comments on commit f3a4abe

Please sign in to comment.