mirror of
https://git.codelinaro.org/clo/tools/repo.git
synced 2025-06-20 18:58:31 +08:00
Add 'repo sync -d' to detach projects from their current topic
The -d flag moves the project back to a detached HEAD state, matching what is listed in the manifest. This can be useful to set a client to something stable (or at least well-known), such as before a sequence of 'repo download' commands are used to get some changes for testing. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@ -573,7 +573,7 @@ class Project(object):
|
||||
for file in self.copyfiles:
|
||||
file._Copy()
|
||||
|
||||
def Sync_LocalHalf(self):
|
||||
def Sync_LocalHalf(self, detach_head=False):
|
||||
"""Perform only the local IO portion of the sync process.
|
||||
Network access is not required.
|
||||
|
||||
@ -594,7 +594,7 @@ class Project(object):
|
||||
|
||||
branch = self.CurrentBranch
|
||||
|
||||
if branch is None:
|
||||
if branch is None or detach_head:
|
||||
# Currently on a detached HEAD. The user is assumed to
|
||||
# not have any local modifications worth worrying about.
|
||||
#
|
||||
|
Reference in New Issue
Block a user