Ticket #51083: patch_src_namespace_def.cpp.diff

File patch_src_namespace_def.cpp.diff, 1.0 KB (added by RJVB (René Bertin), 4 years ago)
  • src/namespace_def.cpp

    diff -ru src/namespace_def.cpp.org src/namespace_def.cpp
    old new  
    5151        }
    5252}
    5353
     54#elif defined(Q_OS_MACX) // MacOS X specific code
     55
     56#include <sys/types.h> // used by chmod()
     57#include <sys/stat.h>  // used by chmod()
     58
     59const QString QGit::SCRIPT_EXT = ".sh";
     60
     61static void adjustPath(QStringList& args, bool*) {
     62/*
     63    Under MacOS X, git typically doesn't live in the PATH
     64    So use GIT_DIR from the settings if available
     65   
     66    Note: I (OC) think that this should be the default behaviour,
     67          but I don't want to break other platforms, so I introduced
     68          the MacOS X special case. Feel free to make this the default if
     69          you do feel the same.
     70*/
     71        if (args.first() == "git" || args.first().startsWith("git-")) {
     72
     73                if (!QGit::GIT_DIR.isEmpty()) // application built from sources
     74                        args.first().prepend(QGit::GIT_DIR + '/');
     75
     76        }
     77}
     78
     79
     80
    5481#else
    5582
    5683#include <sys/types.h> // used by chmod()