Merge branch 'ab/sha1dc'
[gitweb.git] / builtin / hash-object.c
index 2ea36909d2443dc704c035d57840f804fb6f6401..d04baf999a94cfa6a07e74861876d6a9f1c88a6d 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (C) Junio C Hamano, 2005
  */
 #include "builtin.h"
+#include "config.h"
 #include "blob.h"
 #include "quote.h"
 #include "parse-options.h"
@@ -145,7 +146,7 @@ int cmd_hash_object(int argc, const char **argv, const char *prefix)
                char *to_free = NULL;
 
                if (prefix)
-                       arg = to_free = xstrdup(prefix_filename(prefix, arg));
+                       arg = to_free = prefix_filename(prefix, arg);
                hash_object(arg, type, no_filters ? NULL : vpath ? vpath : arg,
                            flags, literally);
                free(to_free);