From 39a86963e93b4a24296ffe96e63c5a189f8d1d07 Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Date: Wed, 22 Jan 2014 15:30:14 +0200
Subject: [PATCH] Set mr_diff state to collected if diff is ok

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
---
 app/models/merge_request_diff.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb
index d06b95daa6..3ea610197e 100644
--- a/app/models/merge_request_diff.rb
+++ b/app/models/merge_request_diff.rb
@@ -130,7 +130,10 @@ class MergeRequestDiff < ActiveRecord::Base
       end
     end
 
-    new_diffs = dump_commits(new_diffs) if new_diffs.present?
+    if new_diffs.present?
+      new_diffs = dump_commits(new_diffs)
+      self.state = :collected
+    end
 
     self.st_diffs = new_diffs
     self.save
-- 
2.30.9