File tree Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -3187,25 +3187,7 @@ static int create_seq_dir(struct repository *r)
3187
3187
3188
3188
static int save_head (const char * head )
3189
3189
{
3190
- struct lock_file head_lock = LOCK_INIT ;
3191
- struct strbuf buf = STRBUF_INIT ;
3192
- int fd ;
3193
- ssize_t written ;
3194
-
3195
- fd = hold_lock_file_for_update (& head_lock , git_path_head_file (), 0 );
3196
- if (fd < 0 )
3197
- return error_errno (_ ("could not lock HEAD" ));
3198
- strbuf_addf (& buf , "%s\n" , head );
3199
- written = write_in_full (fd , buf .buf , buf .len );
3200
- strbuf_release (& buf );
3201
- if (written < 0 ) {
3202
- error_errno (_ ("could not write to '%s'" ), git_path_head_file ());
3203
- rollback_lock_file (& head_lock );
3204
- return -1 ;
3205
- }
3206
- if (commit_lock_file (& head_lock ) < 0 )
3207
- return error (_ ("failed to finalize '%s'" ), git_path_head_file ());
3208
- return 0 ;
3190
+ return write_message (head , strlen (head ), git_path_head_file (), 1 );
3209
3191
}
3210
3192
3211
3193
static int rollback_is_safe (void )
You can’t perform that action at this time.
0 commit comments