Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Suggested fixes by iCR, OpenRefactory, Inc.#1486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletiongit/index/base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,7 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

from ast import Delete
import glob
from io import BytesIO
import os
Expand DownExpand Up@@ -351,7 +352,10 @@ def from_tree(cls, repo: "Repo", *treeish: Treeish, **kwargs: Any) -> "IndexFile

# tmp file created in git home directory to be sure renaming
# works - /tmp/ dirs could be on another device
tmp_index = tempfile.mktemp("", "", repo.git_dir)

# OpenRefactory Warning: The method 'tempfile.mktemp' creates temporary file in an insecure way.
# use 'NamedTemporaryFile' instead of using 'mktemp' to create temporary file
tmp_index = tempfile.NamedTemporaryFile("", "", repo.git_dir).name
arg_list.append("--index-output=%s" % tmp_index)
arg_list.extend(treeish)

Expand Down
4 changes: 3 additions & 1 deletiongit/index/util.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,7 +40,9 @@ class TemporaryFileSwap(object):

def __init__(self, file_path: PathLike) -> None:
self.file_path = file_path
self.tmp_file_path = str(self.file_path) + tempfile.mktemp("", "", "")
# OpenRefactory Warning: The method 'tempfile.mktemp' creates temporary file in an insecure way.
# use 'NamedTemporaryFile' instead of using 'mktemp' to create temporary file
self.tmp_file_path = str(self.file_path) + tempfile.NamedTemporaryFile("", "", "").name
# it may be that the source does not exist
try:
os.rename(self.file_path, self.tmp_file_path)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp