Go to file
Doug Anderson 3ba5f95b46 Fixed repo checkout error message when git reports errors.
In the current version of repo checkout, we often get the error:
  error: no project has branch xyzzy

...even when the actual error was something else.  This fixes it
to only report the 'no project has branch' when that is actually true.

This fix is very similar to one made for 'repo abandon':
  https://review.source.android.com/#change,22207

The repo checkout error is filed as: <http://crosbug.com/6514>

TEST=manual

A sample creating a case where 'git checkout' will fail:

  $ repo start branch1 .
  $ repo start branch2 .
  $ touch bogusfile
  $ git add bogusfile
  $ git commit -m "create bogus file"
  [branch2 f8b6b08] create bogus file
   0 files changed, 0 insertions(+), 0 deletions(-)
   create mode 100644 bogusfile
  $ echo "More" >> bogusfile
  $ repo checkout branch1 .
  error: chromite/: cannot checkout branch1

A sample case showing that we still fail if no project has a branch:

  $ repo checkout xyzzy .
  error: no project has branch xyzzy

Change-Id: I48a8e258fa7a9c1f2800dafc683787204bbfcc63
2011-04-07 16:55:35 -04:00
docs Support repo-level pre-upload hook and prep for future hooks. 2011-03-11 11:53:23 -08:00
hooks Automatically install Gerrit Code Review's commit-msg hook 2010-03-06 19:21:00 -08:00
subcmds Fixed repo checkout error message when git reports errors. 2011-04-07 16:55:35 -04:00
tests Fix error parsing a non-existant configuration file 2009-07-02 16:12:57 -07:00
.gitignore .gitignore: add an entry for repopickles 2009-06-28 15:08:56 -07:00
.project Add PyDev project files to repo 2009-06-02 00:09:07 +02:00
.pydevproject Add PyDev project files to repo 2009-06-02 00:09:07 +02:00
color.py Add -p to repo forall to improve output formatting 2009-04-18 13:49:13 -07:00
command.py Make path references OS independent 2011-01-09 17:39:19 -08:00
COPYING Initial Contribution 2008-10-21 07:00:00 -07:00
editor.py Fix for handling values of EDITOR which contain a space. 2010-08-06 17:05:04 -07:00
error.py Support repo-level pre-upload hook and prep for future hooks. 2011-03-11 11:53:23 -08:00
git_command.py Use os.environ.copy() instead of dict() 2011-01-09 17:39:22 -08:00
git_config.py upload: Catch and cleanly report connectivity errors 2011-01-09 17:39:22 -08:00
git_refs.py Make usage of open safer by setting binary mode and closing fds 2009-04-18 14:48:03 -07:00
git_ssh Don't allow git fetch to start ControlMaster 2010-10-29 08:15:14 -07:00
main.py Add "repo branch" as an alias for "repo branches" 2011-01-09 17:39:22 -08:00
manifest_xml.py Support repo-level pre-upload hook and prep for future hooks. 2011-03-11 11:53:23 -08:00
pager.py Don't start the pager if stdout is a pipe 2009-04-01 07:24:22 -07:00
progress.py Do not emit progress if stderr is not a tty 2010-05-27 16:48:36 -07:00
project.py Fixed repo checkout error message when git reports errors. 2011-04-07 16:55:35 -04:00
repo Bump repo version to 1,10 2011-01-10 09:01:24 -08:00
SUBMITTING_PATCHES Document how to contribute to the repo project 2009-07-02 13:18:55 -07:00
trace.py Fix repo --trace to show ref and config loads 2009-04-18 09:54:51 -07:00