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