Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
hgitaly
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
heptapod
hgitaly
Commits
c4a9e761
Commit
c4a9e761
authored
3 years ago
by
Sushil Khanchi
Browse files
Options
Downloads
Patches
Plain Diff
diff: remove the possibility of getting NameError for newdiffhunk
parent
1602a9e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!88
Merged stable branch into default for release
,
!87
Merged stable branch into default for release
,
!86
diff: fix NameError
Pipeline
#28981
passed
3 years ago
Stage: main
Stage: compat
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hgitaly/service/diff.py
+4
-4
4 additions, 4 deletions
hgitaly/service/diff.py
with
4 additions
and
4 deletions
hgitaly/service/diff.py
+
4
−
4
View file @
c4a9e761
...
...
@@ -213,4 +213,5 @@
# For explicitness, let's instantiate a new BytesIO obj for each file
self
.
curr_diff
.
patch
=
BytesIO
()
for
diffhunk
in
iter_file_hunks
:
self
.
curr_diff
.
patch
.
write
(
diffhunk
)
if
diffhunk
.
startswith
(
b
'
@@
'
):
...
...
@@ -216,8 +217,7 @@
if
diffhunk
.
startswith
(
b
'
@@
'
):
newdiffhunk
=
diffhunk
.
split
(
b
'
\n
'
,
1
)[
-
1
]
lines
=
newdiffhunk
.
splitlines
(
True
)
self
.
curr_diff
.
patch
.
write
(
diffhunk
)
self
.
curr_diff
.
bytes_count
+=
len
(
newdiffhunk
)
diffhunk
=
diffhunk
.
split
(
b
'
\n
'
,
1
)[
-
1
]
lines
=
diffhunk
.
splitlines
(
True
)
self
.
curr_diff
.
bytes_count
+=
len
(
diffhunk
)
self
.
curr_diff
.
line_count
+=
len
(
lines
)
if
self
.
limits
.
collapse_diffs
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment