Skip to content

Commit f094a71

Browse files
jhamet93fcollonval
authored andcommitted
Lowercase Git error messages before checking substring existence (#409)
* Lowercase error messages when checking * Wrong method
1 parent be4a5fa commit f094a71

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jupyterlab_git/git.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ def get_upstream_branch(self, current_path, branch_name):
691691
output, error = p.communicate()
692692
if p.returncode == 0:
693693
return output.decode("utf-8").strip()
694-
elif "fatal: no upstream configured for branch" in error.decode("utf-8"):
694+
elif "fatal: no upstream configured for branch" in error.decode("utf-8").lower():
695695
return None
696696
else:
697697
raise Exception(
@@ -715,11 +715,11 @@ def _get_tag(self, current_path, commit_sha):
715715
output, error = p.communicate()
716716
if p.returncode == 0:
717717
return output.decode("utf-8").strip()
718-
elif "fatal: No tags can describe '{}'.".format(commit_sha) in error.decode(
718+
elif "fatal: no tags can describe '{}'.".format(commit_sha) in error.decode(
719719
"utf-8"
720-
):
720+
).lower():
721721
return None
722-
elif "fatal: No names found" in error.decode("utf-8"):
722+
elif "fatal: no names found" in error.decode("utf-8").lower():
723723
return None
724724
else:
725725
raise Exception(

0 commit comments

Comments
 (0)