Uploaded image for project: 'Sourcetree For Mac'
  1. Sourcetree For Mac
  2. SRCTREE-8015

Hooks don't load the zshrc

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • None
    • 4.2.2
    • Git
    • None
    • Minor

    Description

      Env vars from terminal

      .git/hooks/pre-commit

      #!/bin/sh

      echo "SHELL: $SHELL"
      echo "PATH: $PATH"

      exit 2{}

      As can be observed, regular terminal ENV is different than the hook ENV (eg. PATH is missing /Users/vrabac/.rbenv/shims). I assume it's because the hook running mechanism didn't load the ~/.zshrc.

      Setup configuration

      • Macbook Air M1
      • macOS Ventura 13.2
      • Iterm2
      • OhMyZsh
      • SourceTree (v4.2.2)
      • SourceTree installed with homebrew (the same thing happens with binary downloaded from the official site)
      • I started the SourceTree from the terminal in the project root folder with stree . command

       

      Attachments

        Issue Links

          Activity

            People

              43c951f935c6 Raman Sidarakin
              3fe25263d131 vrabac_266
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: