From patchwork Tue Sep 27 16:08:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Skrab Sah X-Patchwork-Id: 12990910 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7431C54EE9 for ; Tue, 27 Sep 2022 16:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233025AbiI0QKc (ORCPT ); Tue, 27 Sep 2022 12:10:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231739AbiI0QKJ (ORCPT ); Tue, 27 Sep 2022 12:10:09 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A874D1C6110 for ; Tue, 27 Sep 2022 09:08:32 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id r10-20020a1c440a000000b003b494ffc00bso1610594wma.0 for ; Tue, 27 Sep 2022 09:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :message-id:from:to:cc:subject:date; bh=lPMPN7MMbnCmpTxxioUDWegml6JRmoGtpiKZuMxOc7c=; b=gnWBwqAlt0nWazLwKTnm0w9CNmT/FenvxfAKKetTo3vikkOakFe0sbd4OBRMMHMIPu 0c0+0nZG7Hf7Pdyl6PbiDtzVb/JiVa/QBa6TcAvn3sPll2u5xBXgdO8v+womkpE6eE6r lSDn/XUJzDlXuka8/m73jHFq3B8u+yVtMWcsB3hORqeQ6hiSp0ycd2JTt+9F4lbsw3XH 9/tKHHWyfxM52xZAtda+5NyuN8Joh3fLDIy9/cthl8TpQSu2PgVvzS6p+3dFpvFzawOx Let0/X9kbmnRuhlQSYvWyWze+IMAj0sz5OpDealXAN3JA+UfGLTOk455MqPjNnqLwkty SxJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :message-id:x-gm-message-state:from:to:cc:subject:date; bh=lPMPN7MMbnCmpTxxioUDWegml6JRmoGtpiKZuMxOc7c=; b=pRYx/DbwnT4PTOUFxKvx1zKphIkeRabfGke//q1FtsCrIKw/QeOV02iZKcC7sZW7h0 wird1ZH0I5C9ssngvp4BGvShNgpaMAQzodbwSNkPcJOZ5IbnQAlnRjYeobXc5MzICtRS oIUSWI43jBCgHP9TL0BSpSpCQJQMvbFaQUzLYVrLjoD/mczVz5RqKN98cFafwhFRp8Jw Z0DtjpS4I4wWu079u6xA9CW4yVNOhRv4wpYQXIJClTNxfYOumUSaOKVEkipCXNbw1TQf cUaaXY/z7oPuP1G4no/MbXIeQPiQLA07oZy9Hs05t/6ekdybT55jikuLK1ETJZHHltr2 efMA== X-Gm-Message-State: ACrzQf1pfXTTj6+DOznr2mF1gdBIQLM0BKJx63P2jKTGFyy6ydyUE+cm V0vRtZd1vWjnFXfIhZjZeLVF9pyWWDM= X-Google-Smtp-Source: AMsMyM5TJ6M4Zg3GYnpJcjZ68wTeTb8IdCwXSyZGvZpuDebOPQhvblFeLugx/8nEyioSgBaKM7ylAw== X-Received: by 2002:a05:600c:21c2:b0:3b4:7272:bfd3 with SMTP id x2-20020a05600c21c200b003b47272bfd3mr3226736wmj.148.1664294910068; Tue, 27 Sep 2022 09:08:30 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id v11-20020a05600c444b00b003b4c979e6bcsm15181166wmn.10.2022.09.27.09.08.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 09:08:29 -0700 (PDT) Message-Id: Date: Tue, 27 Sep 2022 16:08:28 +0000 Subject: [PATCH] abspath.h is created. Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: skrab-sah , skrab-sah Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: skrab-sah From: skrab-sah replaced declaration of abspath.c from cache.h to abspath.h. abspath.h is generated by using makeheaders tool. Signed-off-by: skrab-sah --- abspath.h file is generated by makeheaders tool 1. we don't need to commit the file. 2. added routin for abspath.c in Makefile. Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1345%2Fskrab-sah%2Fmaster-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1345/skrab-sah/master-v1 Pull-Request: https://github.com/git/git/pull/1345 abspath.c | 10 ++++++++++ abspath.h | 9 +++++++++ cache.h | 21 +-------------------- 3 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 abspath.h base-commit: 4fd6c5e44459e6444c2cd93383660134c95aabd1 diff --git a/abspath.c b/abspath.c index 39e06b58486..1c163bbe651 100644 --- a/abspath.c +++ b/abspath.c @@ -262,6 +262,16 @@ char *absolute_pathdup(const char *path) return strbuf_detach(&sb, NULL); } +/* + * Concatenate "prefix" (if len is non-zero) and "path", with no + * connecting characters (so "prefix" should end with a "/"). + * Unlike prefix_path, this should be used if the named file does + * not have to interact with index entry; i.e. name of a random file + * on the filesystem. + * + * The return value is always a newly allocated string (even if the + * prefix was empty). + */ char *prefix_filename(const char *pfx, const char *arg) { struct strbuf path = STRBUF_INIT; diff --git a/abspath.h b/abspath.h new file mode 100644 index 00000000000..edebc3a53ba --- /dev/null +++ b/abspath.h @@ -0,0 +1,9 @@ +/* This file was automatically generated. Do not edit! */ +#undef INTERFACE +char *prefix_filename(const char *pfx,const char *arg); +char *absolute_pathdup(const char *path); +const char *absolute_path(const char *path); +char *real_pathdup(const char *path,int die_on_error); +char *strbuf_realpath_forgiving(struct strbuf *resolved,const char *path,int die_on_error); +char *strbuf_realpath(struct strbuf *resolved,const char *path,int die_on_error); +int is_directory(const char *path); diff --git a/cache.h b/cache.h index 26ed03bd6de..e226dbcc7d5 100644 --- a/cache.h +++ b/cache.h @@ -646,18 +646,6 @@ const char *setup_git_directory(void); char *prefix_path(const char *prefix, int len, const char *path); char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path); -/* - * Concatenate "prefix" (if len is non-zero) and "path", with no - * connecting characters (so "prefix" should end with a "/"). - * Unlike prefix_path, this should be used if the named file does - * not have to interact with index entry; i.e. name of a random file - * on the filesystem. - * - * The return value is always a newly allocated string (even if the - * prefix was empty). - */ -char *prefix_filename(const char *prefix, const char *path); - int check_filename(const char *prefix, const char *name); void verify_filename(const char *prefix, const char *name, @@ -1299,14 +1287,7 @@ static inline int is_absolute_path(const char *path) { return is_dir_sep(path[0]) || has_dos_drive_prefix(path); } -int is_directory(const char *); -char *strbuf_realpath(struct strbuf *resolved, const char *path, - int die_on_error); -char *strbuf_realpath_forgiving(struct strbuf *resolved, const char *path, - int die_on_error); -char *real_pathdup(const char *path, int die_on_error); -const char *absolute_path(const char *path); -char *absolute_pathdup(const char *path); +#include "abspath.h" const char *remove_leading_path(const char *in, const char *prefix); const char *relative_path(const char *in, const char *prefix, struct strbuf *sb); int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);