summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2021-03-15 09:02:00 -0700
committerWayne Davison <wayne@opencoder.net>2021-03-15 09:35:39 -0700
commit75158e108649b1e1b0095355e1e4273d15f3eff6 (patch)
tree40e81fe24c1f4dad93dff1f5a690a9df5e606e4d /support
parent676537cf29422ec4b6b9013011282071a662f374 (diff)
downloadrsync-75158e108649b1e1b0095355e1e4273d15f3eff6.tar.gz
Fix git-set-file-times's handling of staged changed files.
Diffstat (limited to 'support')
-rwxr-xr-xsupport/git-set-file-times5
1 files changed, 3 insertions, 2 deletions
diff --git a/support/git-set-file-times b/support/git-set-file-times
index 51962d37..24b3fde5 100755
--- a/support/git-set-file-times
+++ b/support/git-set-file-times
@@ -27,11 +27,12 @@ def main():
if not args.tree:
# All modified files keep their current mtime.
- proc = subprocess.Popen(git + 'ls-files -m -z'.split(), stdout=subprocess.PIPE, encoding='utf-8')
+ proc = subprocess.Popen(git + 'status -z --no-renames'.split(), stdout=subprocess.PIPE, encoding='utf-8')
out = proc.communicate()[0]
for fn in out.split('\0'):
- if fn == '':
+ if fn == '' or (fn[0] != 'M' and fn[1] != 'M'):
continue
+ fn = fn[3:]
if args.list:
mtime = os.lstat(fn).st_mtime
print_line(fn, mtime, mtime)