Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

If local GIT Repo is not available to the user running git pull, process will fail (silently in some cases).

オープン
#998 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
git
領域
tooling

調査の方向性

SourceControl.Git.Utils:GetCurrentBranch() と RunGitCommandWithInput("ls-remote", ...) から始め、Pull(1) からの使用箇所を追跡します。アクセスできないリポジトリに対して returnCode と errStream がどのように処理されているかを確認します。git の失敗が空のブランチとして扱われたり pull がスキップされたりするのではなく、エラー出力とともに表面化されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

This was discovered whilst diagnosing a CICD pipeline which execute ##class(SourceContorl.Git.API.).Pull(1), by a GitHub Runner - once, the runner is setup (on Windows) to run as a service.

When setup, by default the Service windows identity is NETWORK_SERVICE. This windows account will have access to the windows folder containing the repository, but the ownership would typically be different.

the Pull(1) method executes

  • git branch --show-current invoked via the method SourceControl.Git.Utils:GetCurrentBranch(), then executes
  • git ls-remote invoked by calling ##class(SourceControl.Git.Utils).RunGitCommandWithInput("ls-remote" ...)

the GetCurrentBranch() never checks error codes, and if it got a branch and in the case of the GitHub Runner service (and a GIT environment not set to make this repo also available to NETWORK_SERVICE), will raise the error (that is logged) saying the command failed fatally as the repo couldnt be accessed.

GetBranch() returns "", and no error condition - and then proceeds to run the second command, which also fails (and doesn't check for failure), but simply reports "Skipping pull because remote branch does not exist".

We need to make all git command handle failures, and this is no exception so I would propose

  1. SourceControl.Git.Utils:GetCurrentBranch() take to arguments byRef, returnCode and errStream, and, if returnCode >0, writes out errStream content and quits with error.
  2. ##class(SourceControl.Git.Utils).RunGitCommandWithInput("ls-remote",..., interprets returnCode and if >0 writes out errStream content and quits with error.

Steve

主要言語
ObjectScript
スター
22
フォーク
15
平均マージ
21日 22時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

intersystems/git-source-control のほかの issue

intersystems/git-source-control の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。