diff options
Diffstat (limited to 'src/refspec.c')
-rw-r--r-- | src/refspec.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/refspec.c b/src/refspec.c index 0ed02f48b..fbdea9d93 100644 --- a/src/refspec.c +++ b/src/refspec.c @@ -120,6 +120,9 @@ int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch) } } + refspec->string = git__strdup(input); + GITERR_CHECK_ALLOC(refspec->string); + return 0; invalid: @@ -133,6 +136,7 @@ void git_refspec__free(git_refspec *refspec) git__free(refspec->src); git__free(refspec->dst); + git__free(refspec->string); } const char *git_refspec_src(const git_refspec *refspec) @@ -145,6 +149,11 @@ const char *git_refspec_dst(const git_refspec *refspec) return refspec == NULL ? NULL : refspec->dst; } +const char *git_refspec_string(const git_refspec *refspec) +{ + return refspec == NULL ? NULL : refspec->string; +} + int git_refspec_force(const git_refspec *refspec) { assert(refspec); |