worktree: avoid 0{40}, too many zeroes, hard to read
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 22 May 2016 09:33:55 +0000 (16:33 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 May 2016 20:19:22 +0000 (13:19 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c
index aaee0e2fe8de091c7b7bac9bd95d8fb5da5f82d9..b53f8024fc60ec8096c7cd6ab3423a15b2915f69 100644 (file)
@@ -262,7 +262,7 @@ static int add_worktree(const char *path, const char *refname,
         */
        strbuf_reset(&sb);
        strbuf_addf(&sb, "%s/HEAD", sb_repo.buf);
-       write_file(sb.buf, "0000000000000000000000000000000000000000");
+       write_file(sb.buf, sha1_to_hex(null_sha1));
        strbuf_reset(&sb);
        strbuf_addf(&sb, "%s/commondir", sb_repo.buf);
        write_file(sb.buf, "../..");