{"thread":{"id":"53224","subject":"[PATCH 0/1] freshen_file(): use NULL `times' for implicit current-time","startedAt":"2020-04-14T15:22:29Z","lastAt":"2020-04-14T15:22:29Z","messageCount":1,"participants":["luciano.rocha@booking.com"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"395416","messageId":"5e95d36e.1c69fb81.8d920.c2ba@mx.google.com","threadId":"53224","inReplyTo":null,"subject":"[PATCH 0/1] freshen_file(): use NULL `times' for implicit current-time","fromName":"","fromEmail":"luciano.rocha@booking.com","sentAt":"2020-04-14T14:53:52Z","receivedAt":"2020-04-14T15:22:29Z","isPatch":true,"sender":{"key":"luciano.rocha@booking.com","avatar":"https://avatars.githubusercontent.com/u/105658188?v=4"},"body":"Hi all,\n\nCurrently freshen_file() consists of:\n  struct utimbuf t;\n  t.actime = t.modtime = time(NULL);\n  return !utime(fn, &t);\n\nThat, however, is permitted only on files that the user owns (for normal\nusers).\n\nSo on a shared repo with split-index enabled, we end up with the\nwarning:\n  $ git status\n  warning: could not freshen shared index '.git/sharedindex.bd736fa10e0519593fefdb2aec253534470865b2'\n\nThe following gives the same end result (updated atime and mtime), and\nis also allowed for any file the user has permissions to write to:\n\n  return !utime(fn, NULL);\n\nSo the following patch changes it to that.\n\nI'm unaware of any system where those two are not equivalent except for\nthe permisison check.\n\nLuciano Rocha (1):\n  freshen_file(): use NULL `times' for implicit current-time\n\n sha1-file.c | 4 +---\n 1 file changed, 1 insertion(+), 3 deletions(-)\n\nRegards,\nLuciano Rocha\n\n-- \n2.26.0\n\n"}]}