Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to get the Git repository's path from Team Explorer's Git Commit Details page

$
0
0

I am adding Git integration to my Visual Studio extension Diff All Files, which allows for quickly diffing (i.e. comparing) all files in the Team Explorer window with a previous version. I have it working with the Git Changes page (in Team Explorer), since when Iget the Microsoft.TeamFoundation.Git.Controls.Extensibility.IChangesExt service the files in it's IncludedChanges property contain the full file path on disk.  However, when working with the Git Commit Details page I get the Microsoft.TeamFoundation.Git.Controls.Extensibility.ICommitDetailsExt service, whose Changes property only contains the file paths relative to the git branch.

I'm using the LibGit2Sharp library to interact with the Git repository, and in able to access the git repository LibGit2Sharp requires the path to a file in the repository.  Since the ICommitDetailsExt Changes property only contains file paths relative to the git repo, I don't know how to get the path to the Git repo.

At first I thought that I could just get access to the path to the solution file using the DTE object, but realized it's possible to view pending changes and previous commits to a Git repo from Team Explorer without have the solution itself open, so that won't work.

So how can I know what Git repository the Git Commit Details page is showing commits from?  None of the other properties on the ICommitDetailsExt service seem to have the repository information that I'm after (i.e. the full file path to a file in the repo).  Is there a different service I could be getting that would give the Git provider information?

I have also posted this question on Stack Overflow in case there's a chance it might get noticed and answered there.

Thanks in advance.


- Dan - "Can't never could do anything"



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>