You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							32 lines
						
					
					
						
							641 B
						
					
					
				
			
		
		
	
	
							32 lines
						
					
					
						
							641 B
						
					
					
				
 | 
						|
module.exports = MoveSummary; | 
						|
 | 
						|
/** | 
						|
 * The MoveSummary is returned as a response to getting `git().status()` | 
						|
 * | 
						|
 * @constructor | 
						|
 */ | 
						|
function MoveSummary () { | 
						|
   this.moves = []; | 
						|
   this.sources = {}; | 
						|
} | 
						|
 | 
						|
MoveSummary.SUMMARY_REGEX = /^Renaming (.+) to (.+)$/; | 
						|
 | 
						|
MoveSummary.parse = function (text) { | 
						|
   var lines = text.split('\n'); | 
						|
   var summary = new MoveSummary(); | 
						|
 | 
						|
   for (var i = 0, iMax = lines.length, line; i < iMax; i++) { | 
						|
      line = MoveSummary.SUMMARY_REGEX.exec(lines[i].trim()); | 
						|
 | 
						|
      if (line) { | 
						|
         summary.moves.push({ | 
						|
            from: line[1], | 
						|
            to: line[2] | 
						|
         }); | 
						|
      } | 
						|
   } | 
						|
 | 
						|
   return summary; | 
						|
};
 | 
						|
 |