sequencer: do not update/refresh index if the lock cannot be held

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2014-04-28 17:55:24 +07:00 коммит произвёл Junio C Hamano
Родитель 16fc2b7a9c
Коммит 33c297aacc
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -679,7 +679,7 @@ static void read_and_refresh_cache(struct replay_opts *opts)
if (read_index_preload(&the_index, NULL) < 0)
die(_("git %s: failed to read the index"), action_name(opts));
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL);
if (the_index.cache_changed) {
if (the_index.cache_changed && index_fd >= 0) {
if (write_index(&the_index, index_fd) ||
commit_locked_index(&index_lock))
die(_("git %s: failed to refresh the index"), action_name(opts));