]> git.ipfire.org Git - thirdparty/git.git/blobdiff - tempfile.h
Merge branch 'jt/t5500-unflake'
[thirdparty/git.git] / tempfile.h
index cddda0a33c3e1ef39c6d294221fc9f7ae5205217..4de3bc77d246ef5ceceabc42e64ae35a9960b26a 100644 (file)
@@ -88,8 +88,16 @@ struct tempfile {
  * Attempt to create a temporary file at the specified `path`. Return
  * a tempfile (whose "fd" member can be used for writing to it), or
  * NULL on error. It is an error if a file already exists at that path.
+ * Note that `mode` will be further modified by the umask, and possibly
+ * `core.sharedRepository`, so it is not guaranteed to have the given
+ * mode.
  */
-struct tempfile *create_tempfile(const char *path);
+struct tempfile *create_tempfile_mode(const char *path, int mode);
+
+static inline struct tempfile *create_tempfile(const char *path)
+{
+       return create_tempfile_mode(path, 0666);
+}
 
 /*
  * Register an existing file as a tempfile, meaning that it will be