grep: factor out do_append_grep_pat()
[gitweb.git] / sha1_file.c
index 92e87ee2254b6e7a675ad2bdf5111ef7a9b8b5ec..32268d11d0c929624729b01f143845b13d7a569c 100644 (file)
@@ -380,7 +380,7 @@ 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"), LOCK_DIE_ON_ERROR);
-       char *alt = mkpath("%s/objects\n", reference);
+       char *alt = mkpath("%s\n", reference);
        write_or_die(fd, alt, strlen(alt));
        if (commit_lock_file(lock))
                die("could not close alternates file");