Merge branch 'sb/branch-avoid-repeated-strbuf-release'
[gitweb.git] / path.c
diff --git a/path.c b/path.c
index 650c66c32d9b857238c86c099ab2d0982e2eb380..00ec04e7a5f9e90b758855a16f420324ee158739 100644 (file)
--- a/path.c
+++ b/path.c
@@ -9,6 +9,7 @@
 #include "worktree.h"
 #include "submodule-config.h"
 #include "path.h"
+#include "packfile.h"
 
 static int get_st_mode_bits(const char *path, int *mode)
 {
@@ -638,7 +639,7 @@ int validate_headref(const char *path)
        struct stat st;
        char buffer[256];
        const char *refname;
-       unsigned char sha1[20];
+       struct object_id oid;
        int fd;
        ssize_t len;
 
@@ -679,7 +680,7 @@ int validate_headref(const char *path)
        /*
         * Is this a detached HEAD?
         */
-       if (!get_sha1_hex(buffer, sha1))
+       if (!get_oid_hex(buffer, &oid))
                return 0;
 
        return -1;
@@ -717,7 +718,7 @@ char *expand_user_path(const char *path, int real_home)
                        if (!home)
                                goto return_null;
                        if (real_home)
-                               strbuf_addstr(&user_path, real_path(home));
+                               strbuf_add_real_path(&user_path, home);
                        else
                                strbuf_addstr(&user_path, home);
 #ifdef GIT_WINDOWS_NATIVE