diff options
author | Alexander_Kabui | 2024-08-02 19:26:33 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-08-02 19:57:21 +0300 |
commit | 3a8309c76846ae680c7ef6fd38a26b6ca4ec4130 (patch) | |
tree | 4fc07819b2e2c9d81c13f3d14e68f0ec430c6a6d /web | |
parent | f2d89a93a2a00b7c12095189da63fd627ff27901 (diff) | |
download | gn-guile-3a8309c76846ae680c7ef6fd38a26b6ca4ec4130.tar.gz |
Add validator to check if prev_commit and current commit match
* this is to prevent merge conflict
Diffstat (limited to 'web')
-rw-r--r-- | web/view/markdown.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/web/view/markdown.scm b/web/view/markdown.scm index 900378e..8632b8b 100644 --- a/web/view/markdown.scm +++ b/web/view/markdown.scm @@ -91,7 +91,15 @@ commit-sha)) -(define (commit-file repo file-path content commit-message username email) + + + +(define* (commit-file repo file-path content commit-message username email #:optional (prev-commit "")) + (if (string=? prev-commit (get-latest-commit-sha1 repo)) + #t + (throw 'system-error (format #f "Commits do no match.Please pull in latest changes for current * ~a * and prev * ~a * " + (get-latest-commit-sha1 repo) prev-commit)) + ) (if (is-repo? repo) (match (file-exists? (string-append repo "/" file-path)) (#t |