Example #1
0
def unstage_paths(args, head="HEAD"):
    status, output = git.reset(head, "--", with_stderr=True, with_status=True, *set(args))
    if status != 128:
        return (status, output)
    # handle git init: we have to use 'git rm --cached'
    # detect this condition by checking if the file is still staged
    return untrack_paths(args, head=head)
Example #2
0
def unstage_paths(args, head='HEAD'):
    status, out, err = git.reset(head, '--', *set(args))
    if status == 128:
        # handle git init: we have to use 'git rm --cached'
        # detect this condition by checking if the file is still staged
        return untrack_paths(args, head=head)
    else:
        return (status, out, err)
Example #3
0
def unstage_paths(args, head="HEAD"):
    status, out, err = git.reset(head, "--", *set(args))
    if status == 128:
        # handle git init: we have to use 'git rm --cached'
        # detect this condition by checking if the file is still staged
        return untrack_paths(args, head=head)
    else:
        return (status, out, err)
Example #4
0
def unstage_paths(args, head='HEAD'):
    status, output = git.reset(head, '--', with_status=True,
                               *set(args))
    if status == 128:
        # handle git init: we have to use 'git rm --cached'
        # detect this condition by checking if the file is still staged
        return untrack_paths(args, head=head)
    else:
        return (status, output)
Example #5
0
def unstage_paths(args, head='HEAD'):
    status, output = git.reset(head, '--', with_stderr=True, with_status=True,
                               *set(args))
    if status != 128:
        return (status, output)
    # handle git init: we have to use 'git rm --cached'
    # detect this condition by checking if the file is still staged
    status, output = git.update_index('--',
                                      force_remove=True,
                                      with_status=True,
                                      with_stderr=True,
                                      *set(args))
    return (status, output)