Skip to content

Commit 7646f3c

Browse files
committed
Add warning when atempting to recursively update to latest and detached
1 parent c881c5a commit 7646f3c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mbed/mbed.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,6 +1965,11 @@ def update(rev=None, clean=False, clean_files=False, clean_deps=False, ignore=Fa
19651965
"This %s is in detached HEAD state, and you won't be able to receive updates from the remote repository until you either checkout a branch or create a new one.\n"
19661966
"You can checkout a branch using \"%s checkout <branch_name>\" command before running \"mbed update\"." % (cwd_type, repo.scm.name), 1)
19671967

1968+
if repo.isdetached() and latest_deps:
1969+
warning(
1970+
"The repo %s is in detached HEAD state, and you won't be able to receive updates from the remote repository until you either checkout a branch or create a new one.\n"
1971+
"You can checkout a branch using \"%s checkout <branch_name>\" command before running \"mbed update\"." % (repo.name, repo.scm.name))
1972+
19681973
if repo.is_local and not repo.rev:
19691974
action("Skipping unpublished empty %s \"%s\"" % (
19701975
cwd_type if top else cwd_dest,

0 commit comments

Comments
 (0)