pre-upload: fix running with upstream repo checkout
The pre-upload script has assumed that, when imported, the repo program
is running out of $CHROMEOS_CHECKOUT/.repo/repo/. This is normally the
case when people use the repo launcher script from depot_tools.
This fails if repo is being run directly from somewhere else. I've got
an upstream version of repo living in /usr/local/src/repo/ (to test the
latest version before we update), so the argv trick no longer works.
Lets switch the logic to use a different fact: when the upload hook is
run, the cwd is always the top level of the repo checkout. This is in
the upstream hook documentation.
TEST=`repo upload` works using local .repo/ and upstream versions
Commit-Ready: Mike Frysinger <email@example.com>
Tested-by: Mike Frysinger <firstname.lastname@example.org>
Reviewed-by: Luis Hector Chavez <email@example.com>
1 file changed