Skip to content

Commit a83b304

Browse files
fix override_applied
1 parent c124fa8 commit a83b304

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

gitCommit/src/gitcommit.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
static char s_commit_hash[11] = {0};
1010
static const char *COMMIT_FILE_PATH = "commitinfo";
11-
static int s_override_applied = 0;
1211

1312
static void RetrieveGitCommit()
1413
{
@@ -67,10 +66,6 @@ static int LuaApplyRevisionOverride(lua_State *L)
6766
{
6867
DM_LUA_STACK_CHECK(L, 0);
6968

70-
if (s_override_applied)
71-
{
72-
return 0;
73-
}
7469
if (s_commit_hash[0] == '\0')
7570
{
7671
return 0;
@@ -99,7 +94,6 @@ static int LuaApplyRevisionOverride(lua_State *L)
9994
lua_setfield(L, -2, "get_config");
10095
lua_pop(L, 1);
10196

102-
s_override_applied = 1;
10397
return 0;
10498
}
10599

@@ -117,7 +111,8 @@ static void LuaInit(lua_State *L)
117111
luaL_setfuncs(L, Module_methods, 0);
118112
lua_setglobal(L, MODULE_NAME);
119113
#else
120-
luaL_register(L, MODULE_NAME, Module_methods); // 0 (lua 5.1)
114+
luaL_register(L, MODULE_NAME, Module_methods);
115+
lua_pop(L, 1);
121116
#endif
122117

123118
if (lua_gettop(L) != top)

0 commit comments

Comments
 (0)