git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GSoC] microporject test_path_is_*

From
MMooga <contact@m-mooga.com>
Date
Mar 27, 2019, 11:28 UTC
Message-ID
<BBF4F6A7-E5CA-4493-B386-AB7A69EA6EFD@m-mooga.com>
In-Reply-To
<CABPp-BHwUoqk79Kf=ynna5x+mCJyOLz66v6pDieyEeM7YCRS+g@mail.gmail.com>
So for example  that is git diff
diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh
index 286bba35d8..fc82965a0f 100755
--- a/t/t2400-worktree-add.sh
+++ b/t/t2400-worktree-add.sh
@@ -66,7 +66,7 @@ test_expect_success '"add" worktree' '
test_expect_success '"add" worktree with lock' '
        git rev-parse HEAD >expect &&
        git worktree add --detach --lock here-with-lock master &&
-       test -f .git/worktrees/here-with-lock/locked
+       test_path_is_file .git/worktrees/here-with-lock/locked



On 26.03.19, 23:07, "Elijah Newren" <git-owner@vger.kernel.org on behalf of newren@gmail.com> wrote:

    Hi,
    
    On Tue, Mar 26, 2019 at 2:10 PM Mooga <contact@m-mooga.com> wrote:
    >
    > Hi,
    > I am still a bit confused about the task itself
    >
    > it’s just text replacing for example:
    > t1400-update-ref.sh , line 194 -> `test_path_is_missing`  has to be ‘test_path_is_file’
    >
    > Thanks
    
    There are several places in the code that use test with -e or -f or -d
    (or -h or...) in order to check for the presence of a
    file/directory/symlink/etc.  For example,
       test -f path1/file1
    This could be made more clear and produce nicer error messages if it
    were instead
       test_path_is_file path1/file1
    
    There are likewise several that use one of
       ! test -e path/to/filename
    or
       ! test -f path/to/filename
    or
      test ! -f path/to/filename
    which could be replaced by
      test_path_is_missing path/to/filename
    
    This GSoC microproject is just about picking one testfile that has
    some of these constructs, and fixing the cases found within that
    testfile.
    
Previous: SZEDER Gábor
Message 9 of 9 in “[GSoC] microporject test_path_is_*”
  1. MoogaMar 26, 2019
  2. Elijah NewrenMar 26, 2019
  3. Ævar Arnfjörð BjarmasonMar 27, 2019
  4. SZEDER GáborMar 27, 2019
  5. Ævar Arnfjörð BjarmasonMar 27, 2019
  6. SZEDER GáborMar 27, 2019
  7. Ævar Arnfjörð BjarmasonMar 27, 2019
  8. SZEDER GáborMar 28, 2019
  9. MoogaMar 27, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.