Hooks don't load the zshrc

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: High
    • None
    • Affects Version/s: 4.2.2
    • Component/s: Git
    • None
    • Minor

      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

       

            Assignee:
            Raman Sidarakin (Inactive)
            Reporter:
            vrabac_266
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: