Merge branch 'jc/maint-co-track'
* jc/maint-co-track: Enhance hold_lock_file_for_{update,append}() API demonstrate breakage of detached checkout with symbolic link HEAD Fix "checkout --track -b newbranch" on detached HEAD Conflicts: builtin-commit.c
This commit is contained in:
@ -388,7 +388,7 @@ static void read_info_alternates(const char * relative_base, int depth)
|
||||
void add_to_alternates_file(const char *reference)
|
||||
{
|
||||
struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
|
||||
int fd = hold_lock_file_for_append(lock, git_path("objects/info/alternates"), 1);
|
||||
int fd = hold_lock_file_for_append(lock, git_path("objects/info/alternates"), LOCK_DIE_ON_ERROR);
|
||||
char *alt = mkpath("%s/objects\n", reference);
|
||||
write_or_die(fd, alt, strlen(alt));
|
||||
if (commit_lock_file(lock))
|
||||
|
Reference in New Issue
Block a user