From 297e7c6ee69077cb063b90a32d22b0b812a95841 Mon Sep 17 00:00:00 2001 From: Victor Boivie Date: Fri, 5 Oct 2012 14:50:05 +0200 Subject: [PATCH] Expand ~ to user's home directory for --reference This allows a user to have a 'repo init' as: $ repo init -u ... --reference=~/mirror Change-Id: Ib85b7c8ffca9d732132c68fe9a8d7f0ab1fa9288 --- subcmds/init.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subcmds/init.py b/subcmds/init.py index 9a4f7118..9a9317e4 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -317,6 +317,10 @@ to update the working directory files. def Execute(self, opt, args): git_require(MIN_GIT_VERSION, fail=True) + + if opt.reference: + opt.reference = os.path.expanduser(opt.reference) + self._SyncManifest(opt) self._LinkManifest(opt.manifest_name)