同步操作将从 src-openEuler/git 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From e5e484f5bb9690ac2aaab2d0ca23e7433b2ac8c0 Mon Sep 17 00:00:00 2001From: Jeff King <peff@peff.net>Date: 2019年8月29日 13:33:48 -0400Subject: [PATCH 05/30] fast-import: delay creating leading directories forexport-marksWhen we parse the --export-marks option, we don't immediately open thefile, but we do create any leading directories. This can be especiallyconfusing when a command-line option overrides an in-stream one, inwhich case we'd create the leading directory for the in-stream file,even though we never actually write the file.Let's instead create the directories just before opening the file, whichmeans we'll create only useful directories. Note that this could changethe handling of relative paths if we chdir() in between, but we don'tactually do so; the only permanent chdir is from setup_git_directory()which runs before either code path (potentially we should take thepre-setup dir into account to avoid surprising the user, but that's anorthogonal change).The test just adapts the existing "override" test to use paths withleading directories. This checks both that the correct directory iscreated (which worked before but was not tested), and that theoverridden one is not (our new fix here).While we're here, let's also check the error result ofsafe_create_leading_directories(). We'd presumably notice any failureimmediately after when we try to open the file itself, but we can give amore specific error message in this case.Signed-off-by: Jeff King <peff@peff.net>---fast-import.c | 7 ++++++-t/t9300-fast-import.sh | 13 +++++++++++--2 files changed, 17 insertions(+), 3 deletions(-)diff --git a/fast-import.c b/fast-import.cindex b05d560d0a..92e84d28a4 100644--- a/fast-import.c+++ b/fast-import.c@@ -1826,6 +1826,12 @@ static void dump_marks(void)if (!export_marks_file || (import_marks_file && !import_marks_file_done))return;+ if (safe_create_leading_directories_const(export_marks_file)) {+ failure |= error_errno("unable to create leading directories of %s",+ export_marks_file);+ return;+ }+if (hold_lock_file_for_update(&mark_lock, export_marks_file, 0) < 0) {failure |= error_errno("Unable to write marks file %s",export_marks_file);@@ -3238,7 +3244,6 @@ static void option_active_branches(const char *branches)static void option_export_marks(const char *marks){export_marks_file = make_fast_import_path(marks);- safe_create_leading_directories_const(export_marks_file);}static void option_cat_blob_fd(const char *fd)diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.shindex f79fcf4c1e..f5f3e2cb71 100755--- a/t/t9300-fast-import.sh+++ b/t/t9300-fast-import.sh@@ -2132,8 +2132,17 @@ test_expect_success 'R: export-marks feature results in a marks file being creat'test_expect_success 'R: export-marks options can be overridden by commandline options' '- git fast-import --export-marks=other.marks <input &&- grep :1 other.marks+ cat >input <<-\EOF &&+ feature export-marks=feature-sub/git.marks+ blob+ mark :1+ data 3+ hi++ EOF+ git fast-import --export-marks=cmdline-sub/other.marks <input &&+ grep :1 cmdline-sub/other.marks &&+ test_path_is_missing feature-sub'test_expect_success 'R: catch typo in marks file name' '--2.17.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。