X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=GitRepo.vala;h=4d8c65dfc084b7495f36e1e269110330bc66609d;hb=88c6e040d6662f8afefd3f9618994d04c3ad303a;hp=6954437cd13cc3971096b4128846e211125717ef;hpb=72a4edfbda67d0bf3eb93a91c28c4084945ddae5;p=gitlive diff --git a/GitRepo.vala b/GitRepo.vala index 6954437c..4d8c65df 100644 --- a/GitRepo.vala +++ b/GitRepo.vala @@ -579,6 +579,23 @@ public class GitRepo : Object return true; } + + public string previewMerge() + { + try { + var lines = this.git({"log", "master...", "--pretty=format:\"%H %P\"" }).split("\n");; + var head = this.git({"log", "-1", "--pretty=format:\"%H %P\"" }); + var last = lines[lines.length-1]; + var start = head.split(" ")[0]; + var end = last.split(" ")[1]; + return this.git({ "diff" , start+".."+end, "--no-color" }); + } catch(Error ee) { + GitMonitor.gitmonitor.pauseError(ee.message); + return "Error getting diff"; + } + + + }