need_repack = True
if not (rig.cur.flags & index.IX_HASHVALID):
if fake_hash:
- rig.cur.gitmode, rig.cur.sha = fake_hash(path)
+ if rig.cur.sha == index.EMPTY_SHA:
+ rig.cur.gitmode, rig.cur.sha = fake_hash(path)
rig.cur.flags |= index.IX_HASHVALID
need_repack = True
if opt.fake_invalid:
else:
line += b' '
if opt.hash:
- line += hexlify(ent) + b' '
+ line += hexlify(ent.sha) + b' '
if opt.long:
line += b'%7s %7s ' % (oct(ent.mode), oct(ent.gitmode))
out.write(line + (name or b'./') + b'\n')