Skip to content

Commit 435330d

Browse files
committed
Fixed git reporting an error while trying to fetch uncommitted changes status for repository with no commits (empty repo)
1 parent dd5ed10 commit 435330d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mbed/mbed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ def status():
474474
return pquery([git_cmd, 'status', '-s'] + (['-v'] if verbose else []))
475475

476476
def dirty():
477-
return pquery([git_cmd, 'diff', '--name-only', 'HEAD'])
477+
return pquery([git_cmd, 'status', '-uno', '--porcelain'])
478478

479479
def untracked():
480480
return pquery([git_cmd, 'ls-files', '--others', '--exclude-standard']).splitlines()
@@ -1180,7 +1180,7 @@ def publish(all=None, top=True):
11801180
sync(recursive=False)
11811181

11821182
if repo.scm.dirty():
1183-
action('Uncommitted changes in \"%s\" (%s)' % (repo.name, relpath(cwd_root, repo.path) or "."))
1183+
action("Uncommitted changes in %s \"%s\" in \"%s\"" % (repo.pathtype(repo.path), repo.name, repo.path))
11841184
raw_input('Press enter to commit and push: ')
11851185
repo.scm.commit()
11861186

0 commit comments

Comments
 (0)