X-Git-Url: http://nitlanguage.org diff --git a/contrib/github_merge.nit b/contrib/github_merge.nit index 89433b8..8a2c545 100644 --- a/contrib/github_merge.nit +++ b/contrib/github_merge.nit @@ -35,7 +35,12 @@ redef class GithubCurl var statuses = get_and_check("https://api.github.com/repos/privat/nit/statuses/{sha}") prm["statuses"] = statuses print "{prm["title"].to_s}: by {prm["user"].json_as_map["login"].to_s} (# {prm["number"].to_s})" - print "\tmergable: {prm["mergeable"].to_s}" + var mergeable = prm["mergeable"] + if mergeable != null then + print "\tmergeable: {mergeable.to_s}" + else + print "\tmergeable: unknown" + end var st = prm["statuses"].json_as_a if not st.is_empty then print "\tstatus: {st[0].json_as_map["state"].to_s}" @@ -93,7 +98,7 @@ if args.length != 1 then var x = curl.get_and_check("https://api.github.com/repos/privat/nit/issues?labels=ok_will_merge") for y in x.json_as_a do var number = y.json_as_map["number"].as(Int) - var pr = curl.getpr(number) + curl.getpr(number) end else # With a arg, merge the PR @@ -115,12 +120,13 @@ else print "Commit {sha} not in local repository; did you fetch github?" return end - if system("git merge --no-commit {sha}") != 0 then + if system("git merge --no-ff --no-commit {sha}") != 0 then system("cp mergemsg `git rev-parse --git-dir`/MERGE_MSG") print "Problem during merge... Let's do the commit manually." return end system("git commit -F mergemsg") print "The merge is made" + mergemsg.write_to(stdout) end