Re: [PATCH 2/4] backup_file dummy function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 7, 2013 at 9:00 PM, Stefan Beller
<stefanbeller@xxxxxxxxxxxxxx> wrote:
> ---
>  pack-write.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/pack-write.c b/pack-write.c
> index e6aa7e3..b728ea2 100644
> --- a/pack-write.c
> +++ b/pack-write.c
> @@ -344,6 +344,11 @@ struct sha1file *create_tmp_packfile(char **pack_tmp_name)
>         return sha1fd(fd, *pack_tmp_name);
>  }
>
> +void backup_file(char *filename)
> +{
> +
> +}
> +

I think the function looks like this (before it got lost after rebase)

+static void backup_file(const char *path)
+{
+       struct stat st;
+       if (repack_flags & REPACK_IN_PROGRESS &&
+           !stat(path, &st)) {
+               struct strbuf old = STRBUF_INIT;
+               strbuf_addf(&old, "%s.old", path);
+               if (rename(path, old.buf))
+                       die_errno("unable to rename pack %s", path);
+               string_list_append(&backup_files, strbuf_detach(&old, NULL));
+       }
+}
+
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]