lib/tmp-repo.rb in tmp-repo-1.0.1 vs lib/tmp-repo.rb in tmp-repo-1.1.0

- old
+ new

@@ -40,10 +40,14 @@ else handle end end + def each_commit_id(&block) + git('log --pretty=format:%H').strip.split("\n").each(&block) + end + def add_all git('add -A') end def commit(message) @@ -66,14 +70,14 @@ parse_status(git('status')) end def git(command) in_repo do - output = `#{git_executable} #{command}` + output = `#{git_executable} #{command} 2>&1` if $?.exitstatus != 0 - raise GitError, output + raise GitError, output.strip end output end end @@ -121,7 +125,7 @@ end end def create_status_hash { modified: [], deleted: [], new_file: [] } - end + end end