Toggle navigation
Toggle navigation
This project
Loading...
Sign in
graykode
/
commit-autosuggestions
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
graykode
2020-11-07 16:33:13 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3ba668ba6fd51e606eef1ea1866fce96710381e2
3ba668ba
1 parent
a2153659
(fixed) Clean up tokenizing logic
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
commit/commit.py
commit/commit.py
View file @
3ba668b
...
...
@@ -60,12 +60,16 @@ def commit_autosuggestions(diffs, endpoint):
added
,
deleted
=
[],
[]
for
change
in
example
.
changes
:
if
change
.
old
==
None
and
change
.
new
!=
None
:
added
.
extend
(
tokenizing
(
change
.
line
,
endpoint
=
endpoint
)
)
added
.
append
(
change
.
line
)
isadded
=
True
elif
change
.
old
!=
None
and
change
.
new
==
None
:
deleted
.
extend
(
tokenizing
(
change
.
line
,
endpoint
=
endpoint
)
)
deleted
.
append
(
change
.
line
)
isdeleted
=
True
# To speed up tokenizing request.
added
=
tokenizing
(
" "
.
join
(
added
),
endpoint
=
endpoint
)
deleted
=
tokenizing
(
" "
.
join
(
deleted
),
endpoint
=
endpoint
)
if
isadded
and
isdeleted
and
example
.
header
.
new_path
:
data
=
{
"idx"
:
idx
,
"added"
:
added
,
"deleted"
:
deleted
}
res
=
requests
.
post
(
...
...
Please
register
or
login
to post a comment