Skip to content

Commit

Permalink
Correct a bug introduced
Browse files Browse the repository at this point in the history
The commit http://trac.mantidproject.org/mantid/changeset/2c291ece8559905907f15f6f001a5cad3654f5fb/
has introduced a bug, that does not update the status of a downloaded directory.

This solves the issue.
re #6177
  • Loading branch information
gesnerpassos committed Apr 17, 2013
1 parent b811db1 commit b99ba46
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,8 @@ namespace API
@param directory_path : the path for the directory.
*/
void ScriptRepositoryImpl::download_directory(const std::string & directory_path_){
std::string directory_path = std::string(directory_path_).append("/");
void ScriptRepositoryImpl::download_directory(const std::string & directory_path){
std::string directory_path_with_slash = std::string(directory_path).append("/");
bool found = false;
for(Repository::iterator it = repo.begin();
it != repo.end(); it++){
Expand All @@ -562,7 +562,16 @@ namespace API
continue;
}
found = true;

if (it->first != directory_path &&
it->first.find(directory_path_with_slash) != 0)
{
// it is not a children of this entry, just similar. Example:
// TofConverter/README
// TofConverter.py
// these two pass the first test, but will not pass this one.
found = false;
continue;
}
// now, we are dealing with the children of directory path
if (!it->second.directory)
download_file(it->first, it->second);
Expand Down

0 comments on commit b99ba46

Please sign in to comment.