Recent changes to the git porcelain-ish shell scripts added
"git-update-index --refresh" in several places. This harmlessly allows
a dirty tree during certain operations that use git-read-tree.
Signed-off-by: Chuck Lever <cel@netapp.com>
noexclude = True):
"""Returns a list of pairs - [status, filename]
"""
noexclude = True):
"""Returns a list of pairs - [status, filename]
"""
- os.system('git-update-index --refresh > /dev/null')
+def refresh_index():
+ """Refresh index with stat() information from the working directory.
+ """
+ __run('git-update-index -q --unmerged --refresh')
+
def rev_parse(git_id):
"""Parse the string and return a verified SHA1 id
"""
def rev_parse(git_id):
"""Parse the string and return a verified SHA1 id
"""
tree_id = rev_parse(new_head + '^0')
if tree_id != get_head():
tree_id = rev_parse(new_head + '^0')
if tree_id != get_head():
if __run('git-read-tree -u -m', [get_head(), tree_id]) != 0:
raise GitException, 'git-read-tree failed (local changes maybe?)'
__head = tree_id
if __run('git-read-tree -u -m', [get_head(), tree_id]) != 0:
raise GitException, 'git-read-tree failed (local changes maybe?)'
__head = tree_id
"""Perform a 3-way merge between base, head1 and head2 into the
local tree
"""
"""Perform a 3-way merge between base, head1 and head2 into the
local tree
"""
if __run('git-read-tree -u -m', [base, head1, head2]) != 0:
raise GitException, 'git-read-tree failed (local changes maybe?)'
if __run('git-read-tree -u -m', [base, head1, head2]) != 0:
raise GitException, 'git-read-tree failed (local changes maybe?)'
if rev2:
diff_str = _output(['git-diff-tree', '-p', rev1, rev2] + files)
else:
if rev2:
diff_str = _output(['git-diff-tree', '-p', rev1, rev2] + files)
else:
- os.system('git-update-index --refresh > /dev/null')
diff_str = _output(['git-diff-index', '-p', rev1] + files)
if out_fd:
diff_str = _output(['git-diff-index', '-p', rev1] + files)
if out_fd:
def switch(tree_id):
"""Switch the tree to the given id
"""
def switch(tree_id):
"""Switch the tree to the given id
"""
if __run('git-read-tree -u -m', [get_head(), tree_id]) != 0:
raise GitException, 'git-read-tree failed (local changes maybe?)'
if __run('git-read-tree -u -m', [get_head(), tree_id]) != 0:
raise GitException, 'git-read-tree failed (local changes maybe?)'
- os.system('git-update-index --refresh > /dev/null')
if base:
orig_head = get_head()
if base:
orig_head = get_head()