minor fixes

This commit is contained in:
Joseph Aquino 2025-12-26 01:26:54 -05:00
parent 4affce9f0f
commit 1edc5ec7cd
3 changed files with 9 additions and 5 deletions

View File

@ -34,5 +34,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT basic-vcs)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(basic-vcs PRIVATE curl)
endif()

View File

@ -122,6 +122,8 @@ int commitTree(int argc, const char** argv)
SHA1 checksum;
checksum.update(commitObject);
const std::string hash = checksum.final();
std::cout << hash << "\n";
const std::filesystem::path hashDir{ std::filesystem::current_path() / ".git" / "objects" / hash.substr(0,2) };
const std::filesystem::path objectFullPath{ hashDir / hash.substr(2) };