-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed rebase-all-branches for auto-abort rebasing on conflicts
- Loading branch information
Showing
6 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -452,6 +452,7 @@ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/lib | |
) | ||
|
||
fold( | ||
cmake | ||
omnn | ||
OpenMind | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fold() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exe() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include <fstream> | ||
#include <iostream> | ||
#include <string> | ||
|
||
// defaults used for rebase-all-branches target | ||
#define INPUT_FILE_DEFAULT SRC_DIR "rebase.cmd" | ||
#define SUFFIX_DEFAULT " || \"" GIT_EXECUTABLE_PATH "\" rebase --abort" | ||
|
||
int main(int argc, char* argv[]) { | ||
if (argc != 3) { | ||
std::cout << "Usage: " << argv[0] << " <input_file> <suffix>" << std::endl; | ||
std::cout << "Defaults used: <input_file>=" INPUT_FILE_DEFAULT " <suffix>=" SUFFIX_DEFAULT << std::endl; | ||
} | ||
|
||
std::string_view input_file = argc == 3 ? argv[1] : INPUT_FILE_DEFAULT; | ||
std::string_view suffix = argc == 3 ? argv[2] : SUFFIX_DEFAULT; | ||
|
||
std::ifstream infile(input_file.data()); | ||
if (!infile.is_open()) { | ||
std::cerr << "Failed to open file: " << input_file << std::endl; | ||
return 1; | ||
} | ||
|
||
std::string output_file = input_file.data(); | ||
output_file += ".new"; | ||
|
||
std::ofstream outfile(output_file); | ||
if (!outfile.is_open()) { | ||
std::cerr << "Failed to create file: " << output_file << std::endl; | ||
return 1; | ||
} | ||
|
||
std::string line; | ||
while (std::getline(infile, line)) { | ||
outfile << line << suffix << std::endl; | ||
} | ||
|
||
infile.close(); | ||
outfile.close(); | ||
|
||
std::remove(input_file.data()); | ||
std::rename(output_file.c_str(), input_file.data()); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters