]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sha1_file.c
Enhance hold_lock_file_for_{update,append}() API
[thirdparty/git.git] / sha1_file.c
index e2cb342a32f31be2b9ffc1867fbfd671fe63cef1..5cfae5d1adb8c386d4e38c1960f60fb3357c17b3 100644 (file)
@@ -385,7 +385,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))