Commit 164955a4 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Git: Use top level for stash working directory



The message in stashPrompt doesn't make sense with an inner directory

Change-Id: Iddbea519915cd22a6882dcafb705d1ed99106db6
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent d567c600
...@@ -2144,19 +2144,24 @@ QProcessEnvironment GitClient::processEnvironment() const ...@@ -2144,19 +2144,24 @@ QProcessEnvironment GitClient::processEnvironment() const
bool GitClient::beginStashScope(const QString &workingDirectory, const QString &keyword, StashFlag flag) bool GitClient::beginStashScope(const QString &workingDirectory, const QString &keyword, StashFlag flag)
{ {
StashInfo &stashInfo = m_stashInfo[workingDirectory]; const QString repoDirectory = findRepositoryForDirectory(workingDirectory);
return stashInfo.init(workingDirectory, keyword, flag); QTC_ASSERT(!repoDirectory.isEmpty(), return false);
StashInfo &stashInfo = m_stashInfo[repoDirectory];
return stashInfo.init(repoDirectory, keyword, flag);
} }
GitClient::StashInfo &GitClient::stashInfo(const QString &workingDirectory) GitClient::StashInfo &GitClient::stashInfo(const QString &workingDirectory)
{ {
QTC_CHECK(m_stashInfo.contains(workingDirectory)); const QString repoDirectory = findRepositoryForDirectory(workingDirectory);
return m_stashInfo[workingDirectory]; QTC_CHECK(m_stashInfo.contains(repoDirectory));
return m_stashInfo[repoDirectory];
} }
void GitClient::endStashScope(const QString &workingDirectory) void GitClient::endStashScope(const QString &workingDirectory)
{ {
m_stashInfo[workingDirectory].end(); const QString repoDirectory = findRepositoryForDirectory(workingDirectory);
QTC_ASSERT(m_stashInfo.contains(repoDirectory), return);
m_stashInfo[repoDirectory].end();
} }
bool GitClient::isValidRevision(const QString &revision) const bool GitClient::isValidRevision(const QString &revision) const
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment