Skip to content

Commit

Permalink
Fix a bug where an empty directory with the name of a project confuse…
Browse files Browse the repository at this point in the history
…d things
  • Loading branch information
toddlipcon committed Aug 10, 2009
1 parent 45a278e commit 14b6442
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crepo.py
Expand Up @@ -86,10 +86,10 @@ def ensure_tracking_branches(args):
"""Ensures that the tracking branches are set up"""
man = load_manifest()
for (name, project) in man.projects.iteritems():
wd = project.dir
if not os.path.exists(wd):
repo = project.git_repo
if not repo.is_cloned():
init_project(name, project)
repo = GitRepo(wd)

branch_missing = repo.command(
["rev-parse", "--verify", "-q", project.refspec],
capture_stdout=True)
Expand Down
2 changes: 2 additions & 0 deletions git_repo.py
Expand Up @@ -35,6 +35,8 @@ def command_process(self, cmdv, **kwargs):
**kwargs)
return p

def is_cloned(self):
return os.path.exists(os.path.join(self.path, ".git"))

def is_dirty(self):
return self.is_workdir_dirty() or self.is_index_dirty()
Expand Down

0 comments on commit 14b6442

Please sign in to comment.