Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
3a305d2a
Commit
3a305d2a
authored
May 06, 2022
by
Arun Babu Neelicattu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcs/git: improve logging for issue debugging
parent
0d418fc0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
src/poetry/vcs/git/backend.py
+20
-2
No files found.
src/poetry/vcs/git/backend.py
View file @
3a305d2a
...
@@ -240,11 +240,16 @@ class Git:
...
@@ -240,11 +240,16 @@ class Git:
remote_refs
=
cls
.
_fetch_remote_refs
(
url
=
url
,
local
=
local
)
remote_refs
=
cls
.
_fetch_remote_refs
(
url
=
url
,
local
=
local
)
logger
.
debug
(
"Cloning <c2>
%
s</> at '<c2>
%
s</>' to <c1>
%
s</>"
,
url
,
refspec
.
key
,
target
)
try
:
try
:
refspec
.
resolve
(
remote_refs
=
remote_refs
)
refspec
.
resolve
(
remote_refs
=
remote_refs
)
except
KeyError
:
# branch / ref does not exist
except
KeyError
:
# branch / ref does not exist
raise
PoetrySimpleConsoleException
(
raise
PoetrySimpleConsoleException
(
f
"Failed to clone {url} at '{refspec.key}'"
f
"Failed to clone {url} at '{refspec.key}', verify ref exists on"
" remote."
)
)
# ensure local HEAD matches remote
# ensure local HEAD matches remote
...
@@ -274,13 +279,26 @@ class Git:
...
@@ -274,13 +279,26 @@ class Git:
# this implies the ref we need does not exist or is invalid
# this implies the ref we need does not exist or is invalid
if
isinstance
(
e
,
KeyError
):
if
isinstance
(
e
,
KeyError
):
# the local copy is at a bad state, lets remove it
# the local copy is at a bad state, lets remove it
logger
.
debug
(
"Removing local clone (<c1>
%
s</>) of repository as it is in a"
" broken state."
,
local
.
path
,
)
remove_directory
(
local
.
path
,
force
=
True
)
remove_directory
(
local
.
path
,
force
=
True
)
if
isinstance
(
e
,
AssertionError
)
and
"Invalid object name"
not
in
str
(
e
):
if
isinstance
(
e
,
AssertionError
)
and
"Invalid object name"
not
in
str
(
e
):
raise
raise
logger
.
debug
(
"
\n
Requested ref (<c2>
%
s</c2>) was not fetched to local copy and cannot"
" be used. The following error was raised:
\n\n\t
<warning>
%
s</>"
,
refspec
.
key
,
e
,
)
raise
PoetrySimpleConsoleException
(
raise
PoetrySimpleConsoleException
(
f
"Failed to clone {url} at '{refspec.key}'"
f
"Failed to clone {url} at '{refspec.key}', verify ref exists on"
" remote."
)
)
return
local
return
local
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment