Skip to content

Commit

Permalink
Merge pull request #317 from llamahunter/fix-github-sync
Browse files Browse the repository at this point in the history
Fix logic error preventing github integration.
  • Loading branch information
Spacerat authored Jun 15, 2016
2 parents 248f579 + e484750 commit d7f3654
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ide/tests/test_find_project_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,12 @@ def test_ignore_invalid_package_file(self):
"src/main.c",
"appinfo.json"
], "", "appinfo.json")

def test_PR_317(self):
""" PR 317 fixes a bug where find_project_root would fail with 11 character filenames """
self.run_test([
"MAINTAINERS",
"package.json",
"src/"
"src/main.c",
], "", "package.json")
2 changes: 2 additions & 0 deletions ide/utils/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def find_project_root_and_manifest(project_items):
# Check if the file is one of the kinds of manifest file
for name in MANIFEST_KINDS:
dir_end = base_dir.rfind(name)
if dir_end == -1:
continue
# Ensure that the file is actually a manifest file
if dir_end + len(name) == len(base_dir):
if is_manifest(name, item.read()):
Expand Down

0 comments on commit d7f3654

Please sign in to comment.