summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/teams.scm.in13
1 files changed, 8 insertions, 5 deletions
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 55242caad1..703d76fe8d 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -770,13 +770,16 @@ and REV-END, two git revision strings."
files))
(define (git-patch->commit-id file)
- "Parse the commit ID from the first line of FILE, a patch produced with git."
+ "Parse the commit ID from FILE, a patch produced with git."
(call-with-input-file file
(lambda (port)
- (let ((m (string-match "^From ([0-9a-f]{40})" (read-line port))))
- (unless m
- (error "invalid patch file:" file))
- (match:substring m 1)))))
+ (let loop ((line (read-line port)))
+ (when (eof-object? line)
+ (error "could not find 'from' commit in patch" file))
+ (let ((m (string-match "^From ([0-9a-f]{40})" line)))
+ (if m
+ (match:substring m 1)
+ (loop (read-line port))))))))
(define (git-patch->revisions file)
"Return the start and end revisions of FILE, a patch file produced with git."