Topic: Problem with commit file to Git Repository with Grit plugin

I have problem with commit upload file to Git repository when I use this code:

      project_name = "git/project""_system.git"
      name =  upload['datafile'].original_filename
      require 'grit'
      Dir.chdir(project_name) do
        r ='.')
        r.working_dir = '/home/.../'+project_name
        i = r.index
        i.add(name, upload['datafile'].read)
        commits = r.commits
        actor =' '+@current_user.surname,
        sha = i.commit(, commits, actor)

Every commit sending file to repository but older file was removing. I working on it for a few days and I can't fixed it.

Last edited by wafcio (2011-04-09 16:09:57)