Skip to content

Commit

Permalink
Merge branch 'jc/maint-refresh-index-is-optional-for-status' into maint
Browse files Browse the repository at this point in the history
* jc/maint-refresh-index-is-optional-for-status:
  status: don't require the repository to be writable
  • Loading branch information
gitster committed Jan 21, 2010
2 parents 9504f3d + ab68545 commit 8f376a5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,13 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
* We still need to refresh the index here.
*/
if (!pathspec || !*pathspec) {
fd = hold_locked_index(&index_lock, 1);
fd = hold_locked_index(&index_lock, !is_status);
refresh_cache(refresh_flags);
if (write_cache(fd, active_cache, active_nr) ||
commit_locked_index(&index_lock))
die("unable to write new_index file");
if (0 <= fd) {
if (write_cache(fd, active_cache, active_nr) ||
commit_locked_index(&index_lock))
die("unable to write new_index file");
}
commit_style = COMMIT_AS_IS;
return get_index_file();
}
Expand Down

0 comments on commit 8f376a5

Please sign in to comment.