test-appliance: kcs: resolve git branch name more reliably

If the user specifies a branch name to KCS, e.g., via "--repo origin"
we need to make sure that git repository is updated before trying to
resolve the branch name, since the reference in the locally cached
repository might be out of date.  On the other hand, the commit
reference is a SHA hash id, we'd rather not do a full git fetch if the
commit is already in the repository.

So the strategy we use is to try to resolve the commit first if it is
all hex digits and at least 7 characters long.  If that fails, then do
a git fetch, and then first try to resolve the commit prefixed with
"origin/", to see if it is branch name in the origin git tree.  If
that fails, then try resolving the bare commit name; this should work
if the commit revision specifier is either a tag or SHA hash id.

Also use the --prune (-p) and --force (-f) options so if the upstream
git branches are rewound or deleted, the local repository accurately
reflects the state of the upstream / remote repository.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 file changed
tree: 6ababb791fb5b402e0e61e8000ddf9ff19050096
  1. Documentation/
  2. fstests-bld/
  3. kernel-build/
  4. release/
  5. run-fstests/
  6. selftests/
  7. test-appliance/
  8. .checkpatch.conf
  9. .dockerignore
  10. .gitignore
  11. .travis.yml
  12. build-appliance
  13. config
  14. COPYING
  15. Dockerfile
  16. Makefile
  17. README.md
  18. setup-buildchroot
README.md

xfstests-bld

The xfstests-bld project was originally designed as system to make it easy to build xfstests in way that isolated it from the versions of various libraries such as libaio, xfsprogs, that were available in a particular distribution. It has since evolved to have four primary functions:

More details about how to use xfstests-bld to carry out these three functions can be found in the Documentation directory.

If you are first getting started using xfstests, you should probably read the Quickstart guide first. If you don't know much about xfstests, you may also want to read this introduction to xfstests.

License

The xfstests-bld project has been made available under the terms of the GNU General Public License, version 2. A copy can be found in the file named COPYING in the distribution.