path: implement common_dir handling in git_pathdup_submodule()
[gitweb.git] / tempfile.c
index 0b5d8ce92985634aae1f89d3fb4c4e2a01f0aaa1..0af7ebf016745c4a114a12d207381342b29ccf4f 100644 (file)
@@ -137,6 +137,14 @@ int create_tempfile(struct tempfile *tempfile, const char *path)
        return tempfile->fd;
 }
 
+void register_tempfile(struct tempfile *tempfile, const char *path)
+{
+       prepare_tempfile_object(tempfile);
+       strbuf_add_absolute_path(&tempfile->filename, path);
+       tempfile->owner = getpid();
+       tempfile->active = 1;
+}
+
 int mks_tempfile_sm(struct tempfile *tempfile,
                    const char *template, int suffixlen, int mode)
 {