githelper.git
/
githelper.pike
version
»
Context lines:
10
20
40
80
file
none
3
githelper.git/githelper.pike:558:
if (old_sha == "0"*40) { // New branch, maybe check if the name is allowed... return 0; } else { string merge_base = String.trim_all_whites(run_git("merge-base", old_sha, new_sha)); if (merge_base != old_sha) { write("Push to %s is not fast-forward.\n", ref_name); return 1; }
+
array(string) fp_path = split_lf(run_git("rev-list", "--first-parent",
+
old_sha+"^.."+new_sha));
+
if (search(fp_path, old_sha)<0) {
+
write("Commit %s does not contain %s in its first-parent ancestry.\nDid you pull with merge instead of rebase?\n", new_sha, old_sha);
+
return 1;
+
}
commits_to_check += split_lf(run_git("rev-list", old_sha+".."+new_sha)); return 0; } } int check_push(string old_sha, string new_sha, string ref_name) { if (has_prefix(ref_name, "refs/tags/")) { return check_tag_push(old_sha, new_sha, ref_name);