Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Add support to 0 to limit char and line
Browse files Browse the repository at this point in the history
  • Loading branch information
inacionery committed Jan 5, 2021
1 parent e307b5f commit bf23e2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git-pull-request/git-pull-request.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,13 +1070,13 @@ def display_pull_request(pull_request):

pr_body = strip_empty_lines(pr_body)

if (options["description-line-limit"] > 0) and (len(pr_body.splitlines()) > options["description-line-limit"]):
if ((options["description-line-limit"] >= 0) and (len(pr_body.splitlines()) > options["description-line-limit"])):
pr_body = pr_body.splitlines()
pr_body = pr_body[:options["description-line-limit"]]
pr_body = "\n".join(pr_body)
pr_body += "..."

if (options["description-char-limit"] > 0) and (len(pr_body) > options["description-char-limit"]):
if ((options["description-char-limit"] >= 0) and (len(pr_body) > options["description-char-limit"])):
pr_body = pr_body[:options["description-char-limit"]] + '...'

print pr_body
Expand Down

0 comments on commit bf23e2e

Please sign in to comment.