Skip to content

Commit

Permalink
Handle '.' in repo name (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhirenmathur authored Nov 4, 2024
1 parent 6b76511 commit 3935edb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/modules/parsing/graph_construction/parsing_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,14 @@ async def download_and_extract_tarball(
except requests.exceptions.RequestException as e:
logger.error(f"Error fetching tarball: {e}")
return e

tarball_path = os.path.join(
target_dir,
f"{repo.full_name.replace('/', '-')}-{branch.replace('/', '-')}.tar.gz",
f"{repo.full_name.replace('/', '-').replace('.', '-')}-{branch.replace('/', '-').replace('.', '-')}.tar.gz",
)

final_dir = os.path.join(
target_dir,
f"{repo.full_name.replace('/', '-')}-{branch.replace('/', '-')}-{user_id}",
f"{repo.full_name.replace('/', '-').replace('.', '-')}-{branch.replace('/', '-').replace('.', '-')}-{user_id}",
)

try:
Expand All @@ -171,6 +170,8 @@ async def download_and_extract_tarball(
extracted_dir = os.path.join(temp_dir, os.listdir(temp_dir)[0])
for root, dirs, files in os.walk(extracted_dir):
for file in files:
if file.startswith("."):
continue
file_path = os.path.join(root, file)
if self.is_text_file(file_path):
try:
Expand Down

0 comments on commit 3935edb

Please sign in to comment.