def orphan_clean(repo, branch):
    orphan(repo, branch)

    # remove any files that have followed us from the previous branch in the
    # index
    files = repo('ls-files', '--cached')
    if files:
        repo('rm', '--cached', '-rf', '--', '.')

    # any removed files will now be in the working copy, note that some files
    # may be both previously managed and ignored, so it's important to use
    # the 'x' too.
    repo('clean', '-fxd')


# -----------------------------------------------------------------------------
# Copyright (C) 2013-2014 Bloomberg Finance L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------ END-OF-FILE ----------------------------------
Compatibility function for using the recarray base class's field method.
dataset/ETHPy150Open bloomberg/phabricator-tools/py/phl/phlgit_checkout.py/orphan_clean--crossover with--dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/fitsrec.py/_get_recarray_field