Skip to content
Snippets Groups Projects
Select Git revision
  • master
1 result

__init__.py

Blame
  • GitCommitHash.m 336 B
    function commitHash = GitCommitHash(inPath)
        bGit = Dev.SetupGit();
        if ( ~bGit )
            return;
        end
        
        oldDir = cd(inPath);
        cleanupObj = onCleanup(@()(cd(oldDir)));
        
        [status,hashOut] = system('git rev-parse HEAD');
        if ( status ~= 0 )
            return;
        end
        
        commitHash = strtrim(hashOut);
    end