Skip to content

Commit

Permalink
Fix git-set-file-times's handling of staged changed files.
Browse files Browse the repository at this point in the history
  • Loading branch information
WayneD committed Mar 15, 2021
1 parent 676537c commit 75158e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions support/git-set-file-times
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 75158e1

Please sign in to comment.