githelper.git
/
githelper.pike
version
»
Context lines:
10
20
40
80
file
none
3
githelper.git/githelper.pike:608:
if (access_level >= 2) /* Skip checks */ return 0; 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) old_depth = split_lf(run_git("rev-list", "--first-parent",
+
"-n", "2", old_sha));
array(string) fp_path = split_lf(run_git("rev-list", "--first-parent",
-
old_sha+"^.."+new_sha));
+
(sizeof(
old_
depth)<2?
+
new_sha :
+
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; } }