public static List<DiffPair> convert(String gitDiffOutput) {

		if (gitDiffOutput == null || "".equals(gitDiffOutput)) {
			return emptyList();
		}

		ArrayList<DiffPair> dps = new ArrayList<DiffPair>();

		String gitDiffOutputChangeable = gitDiffOutput;
		boolean stop = false;
		
		while (true) {
			Matcher matchNewDiff = NEW_DIFF.matcher(gitDiffOutputChangeable);
			
			if (stop) break;

			if (matchNewDiff.find()) {
				int startOfFirstChange = matchNewDiff.start();
				int endOfFirstChange = gitDiffOutputChangeable.length();
				
				if (matchNewDiff.find()) {
					endOfFirstChange = matchNewDiff.start();
				} else {
					
					// Stop on next iteration
					stop = true;
				}
				
				String isolatedCommit = gitDiffOutputChangeable.substring(startOfFirstChange, endOfFirstChange);
				
				List<String> commitLines = Arrays.asList(isolatedCommit.split("\\n"));
				
				DiffPair dp = new DiffPair();
				
				for (String commitLine : commitLines) {
					Matcher oldStringMatch = OLD_STRING.matcher(commitLine);
					Matcher newStringMatch = NEW_STRING.matcher(commitLine);
					
					if (oldStringMatch.find()) dp.setOldString(oldStringMatch.group());
					if (newStringMatch.find()) dp.setNewString(newStringMatch.group());
				}
				
				dps.add(dp);
				
				gitDiffOutputChangeable = gitDiffOutputChangeable.substring(endOfFirstChange);
				
			}
		}
		
		return dps;
	}